Skip to main content

Prefix Sum Quiz

Editorial

13 questions across the three Prefix Sum lessons: which kind of running total a task needs, what the hash map holds, what each step of a template does, and what a small bug does. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Introduction to Prefix Sums, Prefix Sums with a Hash Map or Difference Arrays and 2D Prefix Sums.

Quiz

1 / 13

Multiple choice

An array never changes, and you'll be asked for the sum of nums[l..r] thousands of times. What do you build?