01 · Question
Given a string s, find the length of the longest substring without repeating characters.
The reference implementations below assume ASCII input.
02 · Analysis
Store each character's last index. If it was seen inside the current window, move the left boundary just past that occurrence; never move left backward. Then update the longest length. These reference solutions use an ASCII input contract so Python character indices and Go byte indices agree. Expected O(n) time and O(U) space for U distinct characters. A substring is contiguous; a subsequence is not required to be.
03 · Solution