摘要: 1 class TrieNode: 2 def __init__(self): 3 self.children = dict() 4 self.words = [] 5 6 class Trie: 7 def __init__(self): 8 self.root = TrieNode() 9 10 阅读全文
posted @ 2020-01-14 16:38 Sempron2800+ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def getLevelFriends(self,friends,visited,id,level,l): 3 while len(l) > 0 and level > 0: 4 temp = [] 5 while len(l) > 0: 6 cur = l. 阅读全文
posted @ 2020-01-14 10:37 Sempron2800+ 阅读(207) 评论(0) 推荐(0) 编辑