Leetcode 342 - Power of 4

Note:

• Because n == 4^x == 2^2x, we can do a square root then use lowbit.

Question:

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

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

Example:

Code:

Math O(1)