摘要:
题目描述: 第一次提交:(超出时间限制) class Solution: def findWords(self, board: List[List[str]], words: List[str]) -> List[str]: def dfs(word,i,j,visited): if len(wor 阅读全文
摘要:
题目描述: 方法一: class WordDictionary: def __init__(self): """ Initialize your data structure here. """ #from collections import defaultdict self.lookup = { 阅读全文
摘要:
题目描述: 方法一: class Trie: def __init__(self): """ Initialize your data structure here. """ self.tree = {} def insert(self, word: str) -> None: """ Insert 阅读全文
摘要:
题目描述: 方法一:dfs class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: def dfs(i, adjacency, flags): if flags[i] 阅读全文
摘要:
题目描述: 第一次提交: class Solution: def isIsomorphic(self, s: str, t: str) -> bool: dicA = {} dicB = {} for i in range(len(s)): if s[i] not in dicA: dicA[s[i 阅读全文