Monday, April 11, 2016

LeetCode Q231: Power of Two

Given an integer, write a function to determine if it is a power of two.


Solution 1: Solution 2:

Round 2 solution: Need to take care negtive number and zero:

No comments:

Post a Comment