get inversion by merge sort