Problem 2351 · Easy

First Letter to Appear Twice

Scan left to right with a set of seen letters; the first letter already in the set is the one whose second copy comes earliest.

Open the interactive visualisation