End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
left and right, to the start of the array.max_consecutive to keep track of the maximum number of consecutive 1s found.zero_count to keep track of the number of zeros in the current window.zero_count.zero_count exceeds 1, contract the window from the left until zero_count is 1 or less.max_consecutive with the maximum length of the window seen so far.max_consecutive as the result.