题目描述;
第一次提交;
class Solution: def isUnivalTree(self, root: TreeNode) -> bool: if root == None: return True if root.left!=None and root.left.val!=root.val: return False if root.right!=None and root.right.val != root.val: return False if self.isUnivalTree(root.left) and self.isUnivalTree(root.right): return True else: return False