Description
Given an integer n, return true if it is a power of four. A number is a power of four if it can be expressed as 4^k for some non-negative integer k. Otherwise, return false.
Examples
Input:
n = 16Output:
trueExplanation:
16 = 4².
Input:
n = 5Output:
falseExplanation:
5 is not a power of four. Powers of four are 1, 4, 16, 64, ...
Input:
n = 64Output:
trueExplanation:
64 = 4³, so it is a power of four.
Constraints
- •
-2³¹ ≤ n ≤ 2³¹ - 1