Why my code is giving wrong answers?

https://ide.codingblocks.com/s/451594 ___inversion_count problem