Search
⌘K
Get Premium
Leetcode 303. Range Sum Query - Immutable
Given an immutable integer array, implement a NumArray that returns the sum of elements in any [left, right] range. Because the array is static and queries may be numerous, precompute prefix sums so each query can be answered in O(1) time.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.