Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f742769

Browse files
committed
Time: 23 ms (16.56%) | Memory: 18 MB (5.76%) - LeetSync
1 parent b3ed004 commit f742769

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎326-power-of-three/power-of-three.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def isPowerOfThree(self, n: int) -> bool:
3+
if n == 1:
4+
return True
5+
if n < 1:
6+
return False
7+
return self.isPowerOfThree(n/3)
8+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /