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)


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