Given the root of a binary search tree and a target value, determine whether there exist two distinct nodes whose values sum to the target. Return true or false. The input gives a level-order BST array and the target separated by ' | '.
Input: A level-order BST array and the target, separated by ' | '.
Output: Boolean — true or false.
Input: [5,3,6,2,4,null,7] | 9
Output: true
Explanation: 2 + 7 = 9.Input: [5,3,6,2,4,null,7] | 28
Output: false
Explanation: No pair sums to 28.Input: [2,1,3] | 4
Output: true
Explanation: 1 + 3 = 4.0<=nodes<=10^4valid BST