inversion count of sorted array using merge sort