Steps to One (Binary Reduction)

Given a binary string representing an integer, reduce it to 1 following these rules: if the current value is even, divide by 2; if odd, add 1. Count and return the total number of operations needed. The input string has no leading zeros except for "0" itself.

Examples
Input: "1101"
Output: 6
Hints

Steps to One (Binary Reduction)

Given a binary string representing an integer, reduce it to 1 following these rules: if the current value is even, divide by 2; if odd, add 1. Count and return the total number of operations needed. The input string has no leading zeros except for "0" itself.