摘要:
1. 题目描述 2. 代码 1 class Solution: 2 def isPowerOfThree(self, n: int) -> bool: 3 while n > 2 and n % 3 == 0: 4 n = n // 3 5 return n == 1 阅读全文
posted @ 2020-10-20 20:51
vv_869
阅读(67)
评论(0)
推荐(0)
摘要:
1. 题目描述 2. 代码 1 class Solution: 2 def countPrimes(self, n: int) -> int: 3 nfilter = [False] * n 4 count = 0 5 for i in range(2,n): 6 if nfilter[i]:#非素 阅读全文
posted @ 2020-10-20 20:41
vv_869
阅读(90)
评论(0)
推荐(0)
摘要:
1. 题目描述 2. 代码 1 class Solution: 2 def isHappy(self, n: int) -> bool: 3 s = set([n]) 4 while n != 1: 5 sn = str(n) 6 sums = 0 7 for i in range(len(sn)) 阅读全文
posted @ 2020-10-20 19:30
vv_869
阅读(74)
评论(0)
推荐(0)
浙公网安备 33010602011771号