We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I seem to have the same issue. Funny thing is that the editorial solution says I should implement precisely what I have implemented. For the example [2, 1, 3, 1, 2], merge sort does exactly the same swaps as the ones that are done in the problem example.
Nevertheless, this is failing almost every test case, even when the sorting seems to be working fine.
Merge Sort: Counting Inversions
You are viewing a single comment's thread. Return to all comments →
I seem to have the same issue. Funny thing is that the editorial solution says I should implement precisely what I have implemented. For the example [2, 1, 3, 1, 2], merge sort does exactly the same swaps as the ones that are done in the problem example.
Nevertheless, this is failing almost every test case, even when the sorting seems to be working fine.