Longest Run of Unique Characters
Difficulty: Medium · Pattern: Sliding Window · Concept: General Coding (DSA) — Core Patterns to Drill
Given a string s, find the length of the longest contiguous substring that contains no repeated characters.
Checking every substring is (or with a smarter check). The sliding window pattern does it in one pass: grow a window from the right, and whenever a repeat shows up, shrink from the left just enough to remove it — never restart from scratch.
Your task: implement longest_unique_run(s), returning an integer length (0 for an empty string).
Next: Minimum Window Substring (a harder variant), or continue to Find the Rotation Point