Skip to content

Commit 3cd8b24

Browse files
author
Jiayang Wu
committed
2019-11-13
1 parent e305dd6 commit 3cd8b24

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

0326.3的幂/0326-3的幂.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ def isPowerOfThree(self, n):
44
:type n: int
55
:rtype: bool
66
"""
7-
i = 1
8-
while(i<n):
9-
i *= 3
10-
return i == n
11-
12-
7+
t = 1
8+
while t < n:
9+
t *= 3
10+
return n == t

0 commit comments

Comments
 (0)