Counting inversions in an array via MergeSort