You are given a target of length n.
You have another binary string s of length n, where all characters are initially '0'. You want to make s equal to target.
In one operation, you can choose an index i such that s from index i to index '0' to '1' and '1' to '0'.
Return the minimum number of operations needed to make s equal to target.
Constraints:
n == target.length
n
target[i] is either '0' or '1'.
You are given a target of length n.
You have another binary string s of length n, where all characters are initially '0'. You want to make s equal to target.
In one operation, you can choose an index i such that s from index i to index '0' to '1' and '1' to '0'.
Return the minimum number of operations needed to make s equal to target.
Constraints:
n == target.length
n
target[i] is either '0' or '1'.