func numSteps(s string) int {
cnt, carrier := 0, 0
for i := len(s) - 1; i > 0; i -= 1 {
if s[i] == '0' && carrier == 0 {
cnt += 1
} else if s[i] == '1' && carrier == 1 {
cnt += 1
carrier = 1
} else {
cnt += 2
carrier = 1
}
}
return cnt + carrier
}