# ★☆☆☆☆ 점프와 순간이동

# 구현코드

def solution(n):
    ans = 0
    while n != 0:
        if n%2 == 0:
            n = n/2
        elif n%2 == 1:
            n = n-1
            ans = ans+1
    return ans
1
2
3
4
5
6
7
8
9