342. 4的幂

Posted yuhong1103

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了342. 4的幂相关的知识,希望对你有一定的参考价值。

1 class Solution 
2 {
3 public:
4     bool isPowerOfFour(int num) 
5     {
6         return (num > 0) && ((num & (-num)) == num) && (num % 3 == 1);
7     }
8 };

 

以上是关于342. 4的幂的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode 342 4的幂[循环 递归 位运算] HERODING的LeetCode之路

342. 4的幂

LeetCode342. 4的幂 / 第243场周赛

leetcode刷题笔记342 4的幂

342. 4的幂

[LeetCode] 342. 4的幂