CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Sliding Window
Max Consecutive Ones III
Medium
LeetCode
5/6
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Medium
Sliding Window
LeetCode #1004
Max Consecutive Ones III
Longest window with at most k zeros (you may flip them).
Examples
Example 1
Input
11 2 1 1 1 0 0 0 1 1 1 1 0
Output
6
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results