Minimum Swaps 2

  • + 14 comments

    You don't need to alalyze and swap the last element. Run your loop from 0 to less arr.length-1. It passes all the tests.