Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 995. Minimum Number of K Consecutive Bit Flips
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source