Finding the minimum number of swaps to convert one string to another, where the strings may have repeated characters
问题 I was looking through a programming question, when the following question suddenly seemed related. How do you convert a string to another string using as few swaps as follows. The strings are guaranteed to be interconvertible (they have the same set of characters, this is given), but the characters can be repeated . I saw web results on the same question, without the characters being repeated though. Any two characters in the string can be swapped. For instance : "aabbccdd" can be converted