Data Structures19 sections · 729 units
Open in CourseQuiz: 2D Prefix Sums
Inclusion-exclusion
Check Your Understanding
In the 2D prefix sum query formula, why do we add prefix[r1][c1] at the end?
- A.To include the top-left cell
- B.It's not needed, we could skip it
- C.Because it was subtracted twice when removing the top and left regions
- D.To handle the case when r1 or c1 is zero