Given the root of a binary search tree and a target value, return the value in the BST that is closest to the target. If there are multiple answers, print the smallest.
Example 1:
Input: root = [4,2,5,1,3], target = 3.714286
Output: 4Example 2:
Input: root = [1], target = 4.428571
Output: 1Constraints:
[1, 10⁴].0 <= Node.val <= 10⁹-10⁹ <= target <= 10⁹