You are given an array and one inclusive 1-indexed range. Compute the sum of the values inside that range.
This problem is part of Sorting and Searching practice and is designed to strengthen the Custom Sort pattern.
Return one integer: the sum of values from index l through index r.
Input:
6
-14 3 20 37 54 -26
3 5
Output:
111
Explanation:
1 <= n <= 10^51 <= l <= r <= n-10^9 <= value <= 10^9Implement the starter function for this Easy problem. Read from the raw input string and return only the required answer, with no labels or debug text.
Run Code checks the visible sample cases. Submit checks those samples plus additional hidden cases that follow the same input format and constraints.
6 -14 3 20 37 54 -26 3 5
111