Loading...
Given the level-order array of a BST and an integer k, return the kth smallest value (1-indexed) in the BST.
3,1,4,null,2 1
1
3,1,4,null,2 represents a Binary Search Tree (BST) where the parent node is 3, the left child is 1, the right child is 4, and the right child of the left child is 2.1, 2, 3, 4.k is 1, we need to find the 1st smallest element in the sorted array.1, which is the final output.