← All problemsSign in

303. Range Sum Query - Immutable

LeetCodeArrayDesignPrefix SumOpen on judge ↗

Given an integer array nums, handle multiple queries of the following type: - Calculate the sum of the elements of nums between indices left and right inclusive where left <= right. Implement the NumArray class: - NumArray(int[] nums) Initializes the object with the integer array nums. - int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and right in

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start