Available question text
Given a binary array, find the minimum number of operations that flip any 3 consecutive bits so that all elements become 1, or return -1 if impossible. The core challenge is choosing an optimal sequence of overlapping length-3 flips — solvable by treating flips mod 2 (a linear system over GF(2)) or by a greedy sliding-window/difference approach to track active flips in O(n).
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 3191. Minimum Operations to Make Binary Array Elements Equal to One I
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source