Incredible hulk problem

question aur explanation confuse kr rahe toh quesion samaj nhi aa rha

@anujsharmabadboy you will be given a number n. You have to reach that number by taking some steps. But you can take steps only in powers of 2, like 1, 2, 4, 8, etc.
You have to answer the minimum number of steps required for you to reach the number n, by taking such steps.
n = 3, 2^0 + 2^1 = 3, so ans = 2
n = 4, 2^2 = 4, so ans = 1
n = 5, 2^0 + 2^2 = 5, so ans = 2