Problem 3980 · Medium

Minimum Operations to Transform Binary String

Turn binary string s1 into s2 with the fewest operations, where one operation either sets a single 0 to 1 or clears two adjacent 1s to 0s. Return that count, or -1 when s2 cannot be reached.

Open the interactive visualisation