Problem 159 · Medium

Longest Substring with At Most Two Distinct Characters

Find the longest substring with at most two distinct characters.

Open the interactive visualisation