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.
Hey, @eparas controls the values which n th index of the array value must be equal to n + 1 such as [1,2,3,4] 0.th index must be equal to (0+1) and 2nd index must be (2 + 1) == 3. So the other parts is just for control and cound swap count.
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 →
Hey, @eparas controls the values which n th index of the array value must be equal to n + 1 such as [1,2,3,4] 0.th index must be equal to (0+1) and 2nd index must be (2 + 1) == 3. So the other parts is just for control and cound swap count.