public class Solution { public bool IsPowerOfFour(int num) { return (num > 0) && ((num & (num - 1)) == 0) && ((num & 0x55555555) == num); } }
https://leetcode.com/problems/power-of-four/#/description