We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 078ef54 commit b3cea90Copy full SHA for b3cea90
326. Power of Three
@@ -0,0 +1,8 @@
1
+class Solution {
2
+public:
3
+ bool isPowerOfThree(int n) {
4
+ int e = log(INT_MAX) / log(3);
5
+ int N = pow(3, e);
6
+ return n > 0 && N % n == 0;
7
+ }
8
+};
0 commit comments