Data Structures19 sections · 729 units
Open in Course

Quiz: 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?

  1. A.To include the top-left cell
  2. B.It's not needed, we could skip it
  3. C.Because it was subtracted twice when removing the top and left regions
  4. D.To handle the case when r1 or c1 is zero
Start the roadmap to answer the quizzes and solve the challenges