Example 1

Example 2

The number of nodes in the tree is in the range [1, 104].The depth of the tree is in the range [1, 104].-100 <= Node.val <= 100-105 <= val <= 1051 <= depth <= the depth of tree + 1Example 1

Example 2

The number of nodes in the tree is in the range [1, 104].The depth of the tree is in the range [1, 104].-100 <= Node.val <= 100-105 <= val <= 1051 <= depth <= the depth of tree + 1