Max Consecutive Ones III

Medium · Arrays & Strings · about 15 minutes

Asked at Meta, LinkedIn, Amazon, Microsoft, Google, Grammarly.

nums holds only 0s and 1s. You may turn at most k of the 0s into 1s. How long can the longest unbroken block of 1s become?

Related guides