342. Power of Four
Problem description:
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example 1:1
2Input: 16
Output: true
Example 2:1
2Input: 5
Output: false
Solution:
1 | class Solution: |
time complexity: $O(n)$
space complexity: $O(1)$
reference:
related problem: