326-power-of-three

DevGod
Vtuber
bool isPowerOfThree(int n) { if(n < 1){ return false; } signed long I = 1; signed long max = pow(2,31)-1; for(I = 1; I < max; I=I*3){ if(n == I){return true;} } return false;}
/** * @param {number} n * @return {boolean} */var isPowerOfThree = function(n) { signed long I = 1; signed long max = pow(2,31)-1; for(I = 1; I < max; I=I*2){ if(n == I){return true;} } return false;};