Leetcode 326 Solution
This article provides solution to leetcode question 326 (power-of-three)
Access this page by simply typing in "lcs 326" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/power-of-three
Solution
class Solution {
public:
bool isPowerOfThree(int n) {
if (n <= 0)
return false;
return 1162261467 % n == 0;
}
};