摘要:
方法一: 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 阅读全文
摘要:
方法:递归 O(n) O(n) class Solution: def __init__(self): self.maxSum = float("-inf") def maxPathSum(self, root: TreeNode) -> int: def maxGain(node): if not 阅读全文