Skip to content

Challenge 3: Power of 2

We solve by making use of the & operator in computers. There are many ways to solve this, of which two approaches are simple, and one is a more complex but better solution.

Data Structures and Algorithms Bit Manipulation
Gopi Gorantala