Hi! Can you please tell me what’s wrong with this code for counting inversions? It shows wrong answer every time.
In the MergeSort()
method, you are declarng ‘c’ as 'long long'
but the return-type of the method is 'int'
So this may be the Problem
Here is my Solution! Inv-Count
Try It!
Hi bradley! Thanks! You’re right, return type was the problem. AC now!