Given a binary array `nums`, return the maximum number of consecutive `1`'s in the array if you can flip at most one `0`.
Example 1
Input: nums = [1,0,1,1,0]
Output: 4
Explanation: Flip the 0 at index 1 to get [1,1,1,1,0]. The first four elements are now all 1s, a run of 4.
Example 2
Input: nums = [1,0,1,1,0,1]
Output: 4
Explanation: Flipping the 0 at index 1 joins indices 0-3 into four 1s, and flipping the 0 at index 4 joins indices 2-5 into four 1s. Either way the best run is 4.
Example 3
Input: nums = [0,0,0]
Output: 1
Explanation: Flipping one 0 yields a single 1.
Grow a window that contains at most one 0 (the one you'd flip). When a second 0 enters, shrink from the left until only one 0 remains. The largest window seen is the answer.
Run checks all cases above. Submit evaluates all test cases.