We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Here we dont have that case, but you can still convert to the case here 1,2...n by finding the minimum number in the array and subtracting it with all elements. Then run your algorithm. But it needs to be sequential in that case too.
Cookie support is required to access HackerRank
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 →
Here we dont have that case, but you can still convert to the case here 1,2...n by finding the minimum number in the array and subtracting it with all elements. Then run your algorithm. But it needs to be sequential in that case too.