Problem 1247 · Medium

Minimum Swaps to Make Strings Equal

Two strings made only of x and y must become identical, with each swap exchanging a pair of characters between them; find the fewest swaps. The visual pairs up mismatched positions and groups them by mismatch type.

Open the interactive visualisation