When should the left boundary move?

Practice this question from Longest Substring Without Repeating Characters - Sliding window Pattern Practice Quiz, with options and an explanation.

Question

When should the left boundary move?

Option A — Correct answer

When the current character was seen inside the window

Option B

After every character, always

Option C

Only at the end of the string

Option D

Never

Explanation

Move it when the current character was last seen inside the active window.

Longest Substring Without Repeating Characters - Sliding window Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker