Use inorder to get a sorted array then use double pointers.

Question:

Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target.

Example:

1 2

Input: root = [5,3,6,2,4,null,7], k = 9 Output: true