Given an integer n, turn it into 0 using the fewest operations. In one operation you may flip the rightmost bit, or flip bit i if bit i - 1 is 1 and every bit below i - 1 is 0.
Practise this challenge
All coding challenges