LeetCode – Power of Two (Java)
Given an integer, write a function to determine if it is a power of two. Analysis If a number is power of 2, it’s binary form should be 10…0. So if we right shift a bit of the number and then left shift a bit, the value should be the same when the number >= … Read more