How to Solve Inversion Count ( INVZCNT ) from yesterday lunchtime?

Problem Code : INVZCNT

Since editorial is taking too time, and i am too curious now😛

I can get 50pts if i use enhanced merge sort or fenwick, but can’t think of any way to get 100😫

Please tell me those who’ve solved, what’s the approach


There’s no better way to find inversions than O(nlogn). So i was trying to find some pattern when any array is XORed with a number k. I did find patterns when the numbers in the array were of similar length but it didn’t apply over the whole constrain.
I know this wasn’t of any help but just wanted to know if my approach was correct :stuck_out_tongue:

1 Like