Problem 3090 · Easy

Maximum Length Substring With Two Occurrences

Extend a window one letter at a time and shrink from the left whenever a letter appears a third time; the widest valid window wins.

Open the interactive visualisation