Given an integer n, return true if it is a power of four.

Input: 16 → Output: trueInput: 5 → Output: false

A power of four must be a power of two (only one bit set), and that bit must be in an odd position (bit 0, 2, 4, ...).

class Solution { public boolean isPowerOfFour(int n) { return n > 0 && (n & (n-1)) == 0 && (n & 0x55555555) != 0; } }