If two or more such subarrays exist, return any subarray.
The first line contains a single integer T, representing the number of test cases. Each test case consists of 2 lines as follows:
The first line of each test case contains two single space-separated integers N, and S, representing the size of the array and the required sum respectively.
The second line of each test case will contain N single space-separated integers, representing the elements in the array.
For each test case, return any two (pair) integers representing the starting and ending index of the subarray in an array/list which sum up to the given target sum or [-1, -1] instead if there is no such pair for the given input.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N <= 10^5
-10^14 <= S <= 10^14
-10^9 <= ARR[i] <= 10^9
Time Limit: 1 sec
The idea to approach the problem is if the prefix sum up to ith index is X, and the prefix sum up to jth index is Y and it is found that Y = X + SUM, then the required subarray is found with i as start index and j as end index.