What mistake should be avoided with the left pointer?
Practice this question from Longest Substring Without Repeating Characters - Sliding window Pattern Practice Quiz, with options and an explanation.
Question
What mistake should be avoided with the left pointer?
Option A — Correct answer
Moving left backward
Option B
Updating best after each valid window
Option C
Using a map
Option D
Checking duplicate positions
Explanation
Never move the left pointer backward because that can make the window invalid.