303. Range Sum Query - Immutable

Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5) -> -
相關文章
相關標籤/搜索