Expand the window until a duplicate appears, then shrink from the left until the duplicate is removed.
Use a set or map to track characters in the current window.
Expand right pointer and add character.
If character already in set, shrink left pointer and remove characters until it's valid.
Track the maximum window size.