NeetCode #246LC-1004MediumSliding Window
← Back to All Problems

#246 · #1004 · Max Consecutive Ones III(最大连续 1 的个数 III)

📌 Problem Statement & Constraints

Given a binary array nums and an integer k, return the maximum number of consecutive 1s obtainable if you can flip at most k zeros. Constraints: 1 <= nums.length <= 10^5, nums[i] is 0 or 1, 0 <= k <= nums.length.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!