Maximum Consecutive Ones - 1
easy
1. You are given an array(arr) which contains only 0's and 1's. 2. You have to find the maximum number of consecutive 1's in the given array if you can flip at most one zero.
Constraints
1 <= N <= 10^5 0 <= arr[i] <= 1
Format
Input
A number N arr1 arr2... N numbers
Output
A number representing maximum number of consecutive 1's after flipping at most one zero.
Example
Sample Input
6
1 1 0 0 1 1
Sample Output
3
Question Video