【leetcode】872.Leaf-Similar Trees 解题报告

就是找到二叉树的所有叶子节点,很easy 的DFS 自己的写法 # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def leafSimilar(self, root1,
相关文章
相关标签/搜索