Return true if the integer n equals 4 raised to a nonnegative integer exponent, and false otherwise. In particular, 1 = 4^0 is a power of four.
Follow-up: Can you decide this without loops or recursion?
Example 1:
Input: n = 64
Output: trueExplanation: Multiplying three copies of 4 gives 4 * 4 * 4 = 64.
Example 2:
Input: n = 8
Output: falseExplanation: The consecutive powers 4^1 = 4 and 4^2 = 16 lie on either side of 8, so no integer exponent produces 8.
Example 3:
Input: n = 0
Output: falseExplanation: Every nonnegative integer power of 4 is positive, so 0 is not a power of 4.
Constraints:
-2147483648 <= n <= 2147483647