Sliding Window · Medium
Longest Substring Without Repeating Characters
O(N) · O(min(N, M))
Initialize Sliding Window
Input string: "abcabcbb". Set left pointer L=0, right pointer R=0, maxLen=0.
Array Elements & Pointers
L ↓
a
[0]b
[1]c
[2]a
[3]b
[4]c
[5]b
[6]b
[7]Live Variables & Invariants
s:abcabcbb
L:0
R:0
maxLen:0
windowSet:
Step 1 / 17
6%
Solution Code
LeetCode IDE Console
Test Cases
6 cases from Blind 75 & NeetCode 150
Ask for a hint whenever you get stuck.