Anyone has any idea how to achieve the best solution(with minimum swaps)?

  • 0

    I've been asked this question in a real interview and the followup was that how to achieve minimum swaps. I did some tricks to improve my algorithm for several times and in the end he could not come up with a counterexample. But still he did not seem to be satisfied. Anyone has any ideas?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.