LeetCode 303 Range Sum Query - Immutable(维护前缀和)

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.数组 Example: spa Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRan
相关文章
相关标签/搜索