ProgrammingVery hard
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. 1
- B. 3
- C. 4
- D. 2
Correct answer: D. 2
A 2 x 2 block of ones exists in rows 0 and 1 at columns 2 and 3, and no 3 x 3 block of ones exists.
More C Programming questions
- A grid DP that counts right/down paths for 1000 x 1000 cells should use what memory layout to stay small?
- Which approach finds the maximum sum rectangle in an n x n int matrix with n = 500 within a second in C?
- int a[2][3]; with two rows and three columns in a variable-length array, what is sizeof(a) on a platform with 4-byte int?
- char names[3][6] = {"ab", "cde"}; What is sizeof names[1]?
- Which statement about memset(a, 0, sizeof a) for a 2D int array a[4][5] is correct?
- int a[3][4]; int p = &a[0][0]; Which expression refers to a[2][1]?