270. Closest Binary Search Tree Value

Problem

Given a non-empty BST and a target, find the value in the BST that is closest to the target.

Given the root of a Binary Search Tree (BST) and a target value, find the value in the BST that is closest to the target.

Examples
Input: [[4,2,5,1,3],3.714286]
Output: 4
Hints
Related Problems

270. Closest Binary Search Tree Value

Given a non-empty BST and a target, find the value in the BST that is closest to the target.