ProgrammingHard
A 3 x 4 matrix holds a[i][j] = i * 4 + j + 1. What is the sum of its boundary cells (first and last row, first and last column)?
- A. 60
- B. 70
- C. 65
- D. 54
Correct answer: C. 65
The top row sums to 10, the bottom row to 42, and the two middle-row boundary cells are 5 and 8. 10 + 42 + 5 + 8 = 65.
More C Programming questions
- The number of ways to tile a 2 x 5 board exactly with 2 x 1 dominoes, counting orientations, is what?
- The length of the longest common subsequence of "ABCBDAB" and "BDCAB" is what?
- What is the Levenshtein edit distance between "kitten" and "sitting" (insert, delete, replace, each cost 1)?
- A 5 x 7 int matrix is stored in row-major order. What is the flat offset of the cell at 1-based row 3, column 4?
- On a 4 x 4 grid, a robot moves only right or down from (0,0) to (3,3) and may not enter cell (1,1). How many routes are there?
- Which parameter declaration accepts an int a[3][4] argument from main without a warning?