Search⌘ K
AI Features

Minimum Number of K Consecutive Bit Flips

Minimum Number of K Consecutive Bit Flips asks you to turn a binary array into all ones by flipping exactly k adjacent bits at a time, returning the fewest flips or negative one if impossible.

Statement

We are given a binary arrayAn array consisting of 0s and 1s only. nums ...