Given a binary string $S$ consisting of characters 0
, 1
, and ?
. In one operation, you can:
0
to 1
.?
to 0
or 1
.Determine the minimum number of operations required to transform the string $S$ into a binary string $T$.
Input:
0?1?
1001
Output:
3