Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 533 Bytes

power-of-four.md

File metadata and controls

18 lines (13 loc) · 533 Bytes

Given an integer (signed 32 bits), write a function to check whether it is a power of 4.

Example 1:

Input: 16
Output: true

Example 2:

Input: 5
Output: false

Follow up: Could you solve it without loops/recursion?