Four Corners One Rectangle
A 2D prefix table P is built so that P[i][j] is the sum of the subrectangle from row 1, column 1 through row i, column j, with row 0 and column 0 all zeros.
| P | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 3 | 4 | 8 | 9 |
| 2 | 0 | 8 | 18 | 24 | 31 |
| 3 | 0 | 13 | 26 | 37 | 52 |
| 4 | 0 | 22 | 42 | 62 | 80 |
What is the sum of the subrectangle covering rows 2 through 4 and columns 2 through 4?
Sign in to answer questions and track your progress
Sign In