Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The fastest way to convert n to zero is to remove all set bits starting from the leftmost one. Try some simple examples to learn the rule of how many steps are needed to remove one set bit.
consider n=2^k case first, then solve for all n.