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.
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.