You are not recognized as the original poster of this topic.
class Solution
{
public int numSteps(String s)
{
int steps = 0;
int carry = 0;
for (int i = s.length() -1; i > 0; i--)
{
if (s.charAt(i) - '0' + carry == 1)
{
carry = 1;
steps++;
}
steps++;
}
return steps + carry;
}
}