ProgrammingModerate
Which 2 x 2 product gives the top-left entry of A = [[1, 2], [3, 4]] times B = [[5, 6], [7, 8]]?
- A. 23
- B. 17
- C. 19
- D. 5
Correct answer: C. 19
The top-left entry is row 0 of A dotted with column 0 of B: 1 x 5 + 2 x 7 = 19. 17 wrongly uses row 0 of B (1 x 5 + 2 x 6), and 5 multiplies only the corner entries.
More C Programming questions
- A 3 x 3 grid has one blocked cell at row 1, column 1. How many right-or-down paths lead from the top-left to the bottom-right cell?
- The zigzag scan of the 3 x 3 matrix [[1,2,3],[4,5,6],[7,8,9]] along anti-diagonals, alternating direction (as in JPEG order), gives which…
- In the 3 x 3 matrix [[1,2,3],[4,5,6],[7,8,9]], what is the sum of the boundary cells, leaving the centre out?
- For a 4 x 4 matrix with a[i][j] = 4i + j, what is the sum of the anti-diagonal cells (i, 3 - i)?
- Using a largest-square DP on grid rows [1,0,1,1], [1,1,1,1], [1,1,1,0], what is the side of the largest all-ones square?
- A grid DP that counts right/down paths for 1000 x 1000 cells should use what memory layout to stay small?