摘要: 方法一: class Solution: def patternMatching(self, pattern: str, value: str) -> bool: count_a = sum(1 for ch in pattern if ch == 'a') count_b = len(patter 阅读全文
posted @ 2020-06-22 23:38 oldby 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 方法:递归 O(n) O(n) class Solution: def __init__(self): self.maxSum = float("-inf") def maxPathSum(self, root: TreeNode) -> int: def maxGain(node): if not 阅读全文
posted @ 2020-06-22 00:03 oldby 阅读(54) 评论(0) 推荐(0) 编辑