Minimum Operations to Make Binary Array Elements Equal to One II
Track whether the suffix is currently flipped, and flip from any position that reads zero under those flips.
Track whether the suffix is currently flipped, and flip from any position that reads zero under those flips.