Problem 3706 · Medium
Sweep once across the words and pair each position with its earliest unequal partner.
Open the interactive visualisation