
Input:
'N' = 5, ‘D’ = 6
‘ARR’ = [2, 2, 2, 2, 2]
Output: 2
The pair of indexes satisfying the given conditions are (2, 3) and (3, 4).
The first line will contain the integer 'T', the number of test cases. For each test case
The first line of each test case contains two integers ‘N’ and ‘D’.
The second line of each test case contains ‘N’ integers denoting the elements of array ‘ARR’.
For each test case, print the number of pairs of indexes satisfying the given conditions.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= 'T' <= 10
2 <= 'N', ‘D’ <= 10^5
1 <= ‘ARR[i]’ <= 10^5
Time Limit: 1 sec
Approach:
Algorithm :
Approach:
Algorithm :