leetcode 342. Power of Four
来源:互联网 发布:金猪网络 编辑:程序博客网 时间:2024/06/16 06:17
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example:
Given num = 16, return true. Given num = 5, return false.
Follow up: Could you solve it without loops/recursion?
class Solution {public: bool isPowerOfFour(int num) { return (num & 1431655765) && ((num&num-1)==0); }};
0 0
- LeetCode *** 342. Power of Four
- LeetCode -- 342. Power of Four
- LeetCode-342. Power of Four
- LeetCode 342. Power of Four
- [leetcode] 342. Power of Four
- leetcode-342. Power of Four
- LeetCode.342. Power of Four
- LeetCode 342. Power of Four
- leetcode 342. Power of Four
- 342.[leetcode]Power of four
- leetcode 342. Power of Four
- LeetCode-342.Power of Four
- 【leetcode】342. Power of Four
- LeetCode 342. Power of Four
- LeetCode 342. Power of Four
- [Leetcode]342. Power of Four
- LeetCode 342. Power of Four
- [leetcode] 342. Power of Four
- Catch That Cow
- leetcode 24. Swap Nodes in Pairs
- Linux 命令行历史及其history
- [POJ3189][cqbzoj1640]稳定的奶牛分配 解题报告
- HDU 5862 Counting Intersections (扫描线+树状数组)
- leetcode 342. Power of Four
- C/C++之回调函数
- Linux 最有用的命令--man info 帮助命令
- 网易有道2017内推编程题 构造队列(模拟)
- Socket、Tcp、Udp、Http 的认识及区别
- leetcode 198. House Robber
- 对JSON的一点认识和理解以及JQuery处理JSON
- 小论文之旅(1)
- Java面试题整理