1404. Number of Steps to Reduce a Number in Binary Representation to One #271
Unanswered
mah-shamim
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given the binary representation of an integer as a string
s
, return the number of steps to reduce it to1
under the following rules:2
.1
to it.It is guaranteed that you can always reach one for all test cases.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= s.length <= 500
s
consists of characters '0' or '1's[0] == '1'
Beta Was this translation helpful? Give feedback.
All reactions