When a problem asks for the longest/shortest subarray or substring that satisfies a condition, a window [left, right] that only moves forward is often O(n) instead of O(n²).
Example: longest substring without repeating characters — expand right, if a character is duplicated, advance left until it is unique, track max length. See the pattern lesson for the template.
Judge: Longest substring.