Given an integer array nums, answer many queries of the form: what is the sum of nums[left] through nums[right], inclusive? Implement NumArray with a constructor NumArray(nums) and a method sumRange(left, right). The array never changes after construction.
Given an integer array nums, answer many queries of the form: what is the sum of nums[left] through nums[right], inclusive? Implement NumArray with a constructor NumArray(nums) and a method sumRange(left, right). The array never changes after construction.