Given an integer array , handle multiple queries of the form: what is the sum of elements between indices and inclusive?
You're solving the textbook prefix sum application. You'll build the prefix array once, then answer each query in constant time. Read the problem statement carefully.
Notice the constraints: up to queries. Without prefix sums, that's operations. With prefix sums, it's .