leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0326.cpp (148B)


0 class Solution {
1 public:
2 bool isPowerOfThree(int n) {
3 double x = log10(n) / log10(3);
4 return n > 0 && x == round(x);
5 }
6 };