leetcode
This commit is contained in:
9
leetcode/326.py
Normal file
9
leetcode/326.py
Normal file
@@ -0,0 +1,9 @@
|
||||
class Solution:
|
||||
def isPowerOfThree(self, n: int) -> bool:
|
||||
last=1
|
||||
while last<n:
|
||||
last*=3
|
||||
if last==n:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
Reference in New Issue
Block a user