count number of inversions in an integer array - O(n^2) complexity solution