An array is [1, 2, 3]. What is the sum of its elements?
Answer & explanation
Answer: 6
Add all three values. A prefix-sum representation would store this as the final prefix.
Practice arrays & prefix sums with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
Answer: 6
Add all three values. A prefix-sum representation would store this as the final prefix.