Question
Given a string, return the length of its longest contiguous substring containing no repeated character. ```python def longest_unique_substring_length(text: str) -> int: ... ``` The empty string returns `0`. Treat characters as the language runtime's Unicode characters. Target `O(n)` time and `O(k)` space, where `k` is the number of distinct characters in the active input. ## Staged follow-ups 1. Return the substring or its half-open index range, not just its length. 2. Permit each character to appear at most `m` times. 3. Process a stream in chunks without retaining the entire prefix.