result to store the sum of the subarray sums within the specified range.right, do the following:
a. Pop the smallest sum from the priority queue.
b. If the step is within the range specified by left and right, add the sum to result.
c. If the next index is less than the length of the array, calculate the next subarray sum by adding the element at the next index to the current sum, and push it back into the priority queue.result modulo 1e9+7.