What is probem in this
hi @guptanikhil898, you have misunderstood the problem so what you need to do is find the minimum powers of 2 whose sum leads to n i can explain better with examples
eg 1:-
3
3= 2+1 which is 2^1+2^0
so ans=2;
eg2
4
4 =2^2
so ans=1
eg 3
17
15= 2^0+2^1+2^2+2^3
so all you need to find in this question is number of set bits in the binary representation of the n
In case of any difficulty in application do ask .
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.