Minimum Swaps 2

  • + 1 comment

    Nice approach.

    I was skeptical that it will count the minimal swaps, so I went with mapping solution.

    How can you be sure this will count the minimal swaps?

    Is it a well-known algorithm?