# Leetcode 231 - Power of 2

Note:

• Using iteration is weak.
• LOWBIT! - To get the lowest 1 in a number.
• Power of 2 only has one 1. So n & -n === n.

Question:

Given an integer n, return true if it is a power of two. Otherwise, return false.

An integer n is a power of two, if there exists an integer x such that n == 2x.

Example:

Code:

Math

Iteration