上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 47 下一页
摘要: 题目描述: python提交: import collections class UndergroundSystem: def __init__(self): self.idloop = collections.defaultdict(list) self.count = collections.d 阅读全文
posted @ 2020-03-29 15:11 oldby 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目描述: python提交:O(N^3) class Solution: def numTeams(self, rating: List[int]) -> int: ans = 0 for i in range(len(rating)): for j in range(i,len(rating)) 阅读全文
posted @ 2020-03-29 14:57 oldby 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目描述: python提交: from typing import List import collections class Solution: def findLucky(self, arr: List[int]) -> int: dic = collections.Counter(arr) 阅读全文
posted @ 2020-03-29 14:39 oldby 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法一:O(N) class Solution: def findNumbers(self, nums: List[int]) -> int: ans=0 for num in nums: if len(str(num))%2==0: ans+=1 return ans 方法二:数学 O 阅读全文
posted @ 2019-12-25 19:13 oldby 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 自己的提交: class Solution: def isPossibleDivide(self, nums: List[int], k: int) -> bool: c = collections.Counter(nums) n = len(nums) m = n/k if m%1 ! 阅读全文
posted @ 2019-12-25 19:04 oldby 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 自己的提交: class Solution: def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int: c = collections.Counter() for i in range(l 阅读全文
posted @ 2019-12-25 17:25 oldby 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法一:bfs class Solution: def maxCandies(self, status: List[int], candies: List[int], keys: List[List[int]], containedBoxes: List[List[int]], init 阅读全文
posted @ 2019-12-25 17:11 oldby 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 哈希表 关联数组(Associative Array),映射(Map),特征表(Symbol Table),字典( Dictionary) 可作为哈希的对象是不能改变的,string,int,float,tuple,object set,dict,list可以改变不能作为key,想将list放入哈希 阅读全文
posted @ 2019-12-24 18:50 oldby 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 提交: # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def getDec 阅读全文
posted @ 2019-12-24 14:35 oldby 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 自己的提交: class Solution: def sequentialDigits(self, low: int, high: int) -> List[int]: l,h = len(str(low)),len(str(high)) res = [] def helper(num, 阅读全文
posted @ 2019-12-24 14:30 oldby 阅读(242) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 47 下一页