RK DSA Studio

Longest unique substring

Find the longest contiguous part of a string with no repeated symbols.

Remember: Expand right; shrink past duplicates.

Example: abcabcbb → abc, length 3.

Time: O(n). Auxiliary space: O(min(n, Σ)).

Formula: window length = right − left + 1

The window measures Unicode code points. Σ is the number of distinct symbols.

Complexities describe the underlying algorithm; tutorial snapshots and rendering can use additional resources.

The interactive workspace loads here when JavaScript is available. You can still browse the learning notes and links above without it.