Example 1

Example 2

Example 3

The number of nodes in the tree is in the range [1, 5000].-105 <= Node.val <= 105-109 <= limit <= 109Example 1

Example 2

Example 3

The number of nodes in the tree is in the range [1, 5000].-105 <= Node.val <= 105-109 <= limit <= 109