Round Totals
Easyprefix sums
points holds the points a team scored in each round of a long match, round 0 first. Each entry of queries is [from, to] (inclusive, 0-based, from <= to).
Return, for every query in order, the total points scored from round from through round to. The largest test has 20,000 rounds and 12,000 queries, so answer each query without re-adding the whole range.
Examples
Input: points = [3,1,4,1,5], queries = [[0,2],[1,1],[0,4]]
Output: [8,1,14]