You are viewing a single comment's thread. Return to all comments →
why are you cloning the array and sorting it? check arr[i] != i+1 instead.
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Swaps 2
You are viewing a single comment's thread. Return to all comments →
why are you cloning the array and sorting it? check arr[i] != i+1 instead.