Data Structures19 sections · 729 units
Open in Course

Problem - Longest Substring

Variable window classic

Given a string, find the length of the longest substring without repeating characters. You're solving the classic variable-size sliding window problem.

You expand the window until you see a repeat, then shrink until the constraint is satisfied again. Read the problem. The string can have up to 5×1045 \times 10^4 characters.