Leetcode 231 Solution
This article provides solution to leetcode question 231 (power-of-two)
Access this page by simply typing in "lcs 231" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/power-of-two
Solution
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
return n & (n - 1) == 0 and n != 0