摘要: from typing import List# 八皇后问题,用递归的方法来写。class Solution: def solveNQueens(self, n: int) -> List[List[str]]: # 如果n < 1直接返回空列表 if n < 1:return [] # 定义变量用 阅读全文
posted @ 2020-07-13 19:51 月为暮 阅读(230) 评论(0) 推荐(0) 编辑
摘要: from typing import Listclass Solution: def findSubstring(self, s: str, words: List[str]) -> List[int]: # 导入计数类 from collections import Counter # 如果s和w 阅读全文
posted @ 2020-07-13 19:15 月为暮 阅读(169) 评论(0) 推荐(0) 编辑