Root Equals Sum of Children

1
2
3
def check_tree(root)
    (root.left.val + root.right.val) == root.val
end