Search
⌘K

Leetcode 1529. Minimum Suffix Flips

Given a binary target string and an all-zero source, you may flip any suffix [i..n-1]; find the minimum number of such suffix-flip operations to obtain target. This is a greedy/observation problem: the optimal number equals the count of bit transitions in target when including the initial change from '0'.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.