Given the root of a binary search tree and an integer k (1-indexed), return the k-th largest key in the BST. The input gives a level-order BST array and k separated by ' | '.
Input: A level-order BST array and k, separated by ' | '.
Output: Integer — the k-th largest key.
Input: [8,3,10,1,6,null,14] | 2
Output: 10
Explanation: Largest keys 14,10; 2nd is 10.Input: [4,2,7,1,3] | 1
Output: 7
Explanation: Largest key.Input: [5] | 1
Output: 5
Explanation: Single node.1<=k<=nodes<=10^4valid BST