摘要: 题目描述: 提价: class Solution: def maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int: horizontalCuts.sort() vertical 阅读全文
posted @ 2020-06-01 10:30 oldby 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 提交: class Solution: def minReorder(self, n: int, connections: List[List[int]]) -> int: connect = collections.defaultdict(set) c_set = set(tuple( 阅读全文
posted @ 2020-06-01 10:27 oldby 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 提交: class Solution: def hasAllCodes(self, s: str, k: int) -> bool: k_list = set() if k > len(s): return False for i in range(len(s) - k + 1): if 阅读全文
posted @ 2020-06-01 10:13 oldby 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法:动态规划 自底向上: class Solution: def cherryPickup(self, A): R, C=len(A), len(A[0]) from functools import lru_cache @lru_cache(None) def dp(r,c1,c2) 阅读全文
posted @ 2020-06-01 10:06 oldby 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 提交:超时 class Solution: def checkIfPrerequisite(self, n: int, prerequisites: List[List[int]], queries: List[List[int]]) -> List[bool]: dic = colle 阅读全文
posted @ 2020-06-01 09:23 oldby 阅读(175) 评论(0) 推荐(0) 编辑