文章浏览阅读130次。一. 题目题目示例二. 方法一: 优化暴力(超时)解题思路解题代码def getPrime(self, num: int): index = 2 while index <= int(math.sqrt(num)): if num % index == 0: return False index += 1 return Truedef countPrimes(self, n:......
文章浏览阅读150次。【1】两数之和class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i in range(len(nums)): for j in range(len(nums)): if(i==j): continue if(nums[i]+nums[j_日志处理a......