root, its left child and its right child.
Return True if the root's value equals the sum of its two children's values, and False otherwise.root=tree_node([7, 9, -2]) → True
9 + (-2) = 7, which is exactly the root's value.
root=tree_node([4, 2, 3]) → False
2 + 3 = 5, but the root holds 4.
root=tree_node([0, 0, 0]) → True
root=tree_node([7, 9, -2])
True
Run checks the first 3 tests in your browser. Submit checks all 68 tests on the server, hidden ones included.