Example 1

Example 2

The number of nodes in the given tree will be in the range [1, 100].0 <= Node.val <= 1000Example 1

Example 2

The number of nodes in the given tree will be in the range [1, 100].0 <= Node.val <= 1000