Example 1

Example 2

The number of nodes in the tree is in the range [1, 500].0 <= Node.val <= 500All the values Node.val are unique.target is the value of one of the nodes in the tree.0 <= k <= 1000Example 1

Example 2

The number of nodes in the tree is in the range [1, 500].0 <= Node.val <= 500All the values Node.val are unique.target is the value of one of the nodes in the tree.0 <= k <= 1000