Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 995. Minimum Number of K Consecutive Bit Flips
Given a binary array and an integer k, compute the minimum number of length-k subarray flips needed to make all elements 1 (or return -1 if impossible). The core challenge is handling overlapping flips efficiently — use a greedy left-to-right approach that tracks the current parity of applied flips (via a difference array or sliding window) to decide when to flip.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.