What is the window invariant in Longest Substring Without Repeating Characters?

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

Question

What is the window invariant in Longest Substring Without Repeating Characters?

Option A

The window is sorted

Option B — Correct answer

The window has no duplicate characters

Option C

The window has only vowels

Option D

The window always starts at index 0

Explanation

The current window must contain no duplicate characters.

Longest Substring Without Repeating Characters - Sliding window Pattern Practice Quiz

All questions · Next question

Open on QuizMaker