LEETCODE
UNLOCKED
Problems
Donate
Tools
Range Sum Query 2D - Immutable
Solution Code
Python
Java
C++
Javascript
Copy
Verifying access...
Video Guide
Leetcode Daily
Time Complexity
O(
M N
)
for initialization,
O(
1
)
per query
Space Complexity
O(
M N
)
to store the prefix grid
Buy the VIVO Glass Deskpad
Available on Amazon
Affiliate