Problem Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? Code: class Solution { public: bool isPowerOfThree(int n) { if (n <= 0) return 0; int max_pow3 = log10(I…