
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example
No.1
Input: 16
Output: true
No.2
Input: 5
Output: false
Follow up
Could you solve it without loops/recursion?
Code
1 |
public boolean (int num) { |

Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Input: 16
Output: true
Input: 5
Output: false
Could you solve it without loops/recursion?
1 |
public boolean (int num) { |
近期评论