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