303 Range Sum Query - immutable
Given an integer array nums, find the sum of the elements between indicesiandj(i≤j), inclusive.
Example:
Note:
You may assume that the array does not change.
There are many calls to sumRange function.
这题就是求个一维的prefix sum,然后查询。
Last updated