Find "inverse" in array : a[n] is  an array with n element, If i <j and a[i]>a[j] then (a[i], a[j]) called "inverse". For example, array a[5]={2, 3, 8, 6, 1} have 5 "inverse"
(8,6) (2,1) (3,1) (8,1) (6,1)
write code in c++ to find "inverse" in array. but running time must be O(nlogn)
Any idea?