I am not sure exactly which link i should send here
. I think as this question belongs to particular course that’s why its not accessible . So in that case how can we send the test link .
I am copy pasting the same question below .
INVERSION COUNT
You are given an array A find out number of pairs (i,j) in array A such that A[i] > A[j] and i < j.
Input Format:
The first line consists of number of test cases t. Each test case consists of integer N followed by N space separated integers.
Constraints:
1 <= N <= 100000 1 <= t <= 20 0 <= A[i] <= 100000000
Output Format
The number of inversions in array
Sample Input
2 4 1 2 4 3 3 3 2 1
Sample Output
1 3