Debugging Inversions O(nlogn) algorithm