487. Max Consecutive Ones II

Given a binary array nums (containing only 0s and 1s), find the maximum number of consecutive 1s you can obtain by flipping at most one 0 to 1.

Examples
Input: [1,0,1,1,0]
Output: 4
Hints
Related Problems

487. Max Consecutive Ones II

Given a binary array `nums` (containing only 0s and 1s), find the maximum number of consecutive 1s you can obtain by flipping at most one 0 to 1.