Identify which core algorithmic pattern best fits a problem asking for the longest substring without repeating characters.
You must find the length of the longest substring of a string that contains no repeating characters, in O(n) time. Which core pattern is the most natural fit, and why?