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: [0,0,0,0,0,0,0,0]
Output: 1
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.