Incredible Hulk Question

How to solve this question, not getting the approach, but thought that it should be broken in power of 2 and no of powers in which it is broken, will be the steps, but then not able to implement this approach.

Hello @Sakshi2004 just count the number of set bits in the ‘n’ and that will be your answer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.