https://codeforces.com/problemset/problem/1372/C
here- https://ide.codingblocks.com/s/588906
here my program logic is that I have sorted the array then checked out if the both are equal then the ans is 0
then i have checked elementwise with the given array and the sorted array and then if they are the same I have incremented the count (the no of m=nos which are in there sorted position)
then the no of exchanges is count -1
Please tell me where my logic i s wrong and what should be the approach