2236. Root Equals Sum of Children
Easy
Last updated
Easy
Last updated
You are given the root
of a binary tree that consists of exactly 3
nodes: the root, its left child, and its right child.
Return true
if the value of the root is equal to the sum of the values of its two children, or false
otherwise.
Example 1:
Example 2:
Constraints:
The tree consists only of the root, its left child, and its right child.
-100 <= Node.val <= 100
和 2235. 一樣,有點濫竽充數的一題
Runtime: 0 ms, faster than 100.00%
Memory Usage: 2 MB, less than 95.31%