Search⌘ K
AI Features

Solution: Max Consecutive Ones III

Solution: Max Consecutive Ones III asks you to find the longest consecutive segment of a binary array after flipping at most a given number of zeros to ones.

Statement

Given a binary array nums and an integer k, return the maximum number of consecutive 11's in nums if you are allowed to flip at most k zeros to ones. ...