✅  ❌ {{ user_message.number_answer }}

Range Sum Query - Immutable ❄️

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.

Examples for array [-2, 0, 3, -5, 2, -1]:

  • Query(0, 2) => 1
  • Query(2, 5) => -1
  • Query(0, 5) => -3

Problem at Leetcode

Start Chat