Leetcode 326 Power of Three
using namespace std;
class Solution {
public:
bool isPowerOfThree(int n) {
return n > 0 && 1162261467 % n == 0;//116226467是比int最大值小的最大的3的幂次,3的19次方
}
};
using namespace std;
class Solution {
public:
bool isPowerOfThree(int n) {
return n > 0 && 1162261467 % n == 0;//116226467是比int最大值小的最大的3的幂次,3的19次方
}
};