487. Max Consecutive Ones II

    [LeetCode] 487. Max Consecutive Ones II

    487. Max Consecutive Ones II Medium 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: - If we flip the first zero, nums becomes [1,1,1,1,0] and we have 4 consecutive ones. - If we flip the second zero, nums becomes [1,0,1,1,1] and we have 3 consecutive ones. The max numbe..