Problem 2531 · Medium

Make Number of Distinct Characters Equal

Swapping one letter between two words changes only two letter counts, so each candidate swap can be checked from the counts alone.

Open the interactive visualisation