Algorithm course solution to count up inversions during merge sort exectuion