

1 <= L < R <= N.
Let S = A[L] + A[L+1] + …. + A[R-1] + A[R], then S % K = 0.
The first line contains 'T', denoting the number of tests.
For each Test :
The first line contains two space-separated integers, 'N' and 'K', denoting the size of array and number K, respectively.
The second line contains an array 'A' of length 'N'.
For each test, print an integer (either 0 or 1), denoting whether a subarray fulfilling given conditions is found.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= 'T' <= 10
1 <= 'N' <= 10^5
1 <= 'K' <= 10^9
0 <= A[i] <= 10^9 i ∈ (1, N)
Note - Sum of 'N' over all test cases does not exceed 10^5.
Time Limit: 1 sec
Algorithm:
Use this property on the prefix sum of array 'A'. Let's assume that our answer is subarray A[L, R], whose sum is a multiple of K; then we can say that [ sum(A[1, L-1]) % K = sum(A[1, R]) % K ].
Maintain a hashmap and store the remainder of the prefix sum for each index 'i'. For each 'i', first check if the same remainder has occurred earlier. If the remainder has occurred, fetch its index, and if there are at least two elements (i-th inclusive) after that index, return 1.
If the remainder has not previously occurred, store its index (currently 'i') in the hashmap and process the remaining array.
If no repeated remainder is found, return 0.
Algorithm: