You are viewing a single comment's thread. Return to all comments →
this solution will never work for the test cases. this will only return true, if all the elements are within the range of their indexes.
for example, for the following example: this will fail. 1. 2 3 4 5
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 →
this solution will never work for the test cases. this will only return true, if all the elements are within the range of their indexes.
for example, for the following example: this will fail. 1. 2 3 4 5