摘要:
129 Sum Root to Leaf Numbers基本就是递归了class Solution: def __init__(self): self.ans = 0 def sumNumbers(self, root): self.help(root, ""... 阅读全文
摘要:
071 Simplify Path有了split,天下我有class Solution: # @param {string} path # @return {string} def simplifyPath(self, path): stack = [] ... 阅读全文
摘要:
114 Flatten Binary Tree to Linked List这道题就是Preorder的稍微变种, 记住 pre 的节点就好class Solution: def __init__(self): self.pre = TreeNode("dummy") ... 阅读全文