Max Consecutive Ones I
Sliding Window
Problem
Given a binary array, find the maximum number of consecutive 1s in this array.
For example:
Thought Process
Apply sliding window technique. This is an easy problem
When a zero is come across, update start index
Solution
Key Points
When an element is a zero, update starting position of window to be the next index
Time Complexity
Last updated