problem
solution: Iteration
class Solution { public: bool isPowerOfThree(int n) { if(n<1) return false;//err. while(n%3==0) { n /= 3; } return n==1;//err. } };
ref
1. Leetcode_326_Power of Three;
2. GrangYang;
3. A summary of `all` solutions;
end