#Number of Steps to Reduce a Number to Zero
#https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/

class Solution:
    def numberOfSteps (self, num: int) -> int:
        ans = 0
        while(num > 0):
            if num%2 == 0:
                num = num//2
            else:
                num -= 1
            ans+=1

        return ans

18faa28251e6bedb843b187d4ce5a0d206cd4752
<mask token>

class Solution:
    <mask token>

class Solution:

    def numberOfSteps(self, num: int) ->int:
        ans = 0
        while num > 0:
            if num % 2 == 0:
                num = num // 2
            else:
                num -= 1
            ans += 1
        return ans

#Number of Steps to Reduce a Number to Zero
#https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/

class Solution:
    def numberOfSteps (self, num: int) -> int:
        ans = 0
        while(num > 0):
            if num%2 == 0:
                num = num//2
            else:
                num -= 1
            ans+=1

        return ans
