Dynamic Programming21 sections · 916 units
Open in Course

Quiz: 2D Prefix Sums

Knowledge check

Check Your Understanding

In 2D prefix sums, to get sum of rectangle (r1,c1) to (r2,c2), what formula do we use?

  1. A.prefix[r2][c2]
  2. B.prefix[r2][c2] - prefix[r1-1][c2] - prefix[r2][c1-1] + prefix[r1-1][c1-1]
  3. C.prefix[r2][c2] - prefix[r1][c1]
  4. D.prefix[r2][c2] + prefix[r1][c1]
Start the roadmap to answer the quizzes and solve the challenges