Given the root of a binary search tree and an integer k, return the value of the k-th smallest element in the tree.
k is 1-indexed, so k = 1 asks for the minimum value. You may assume 1 ≤ k ≤ the number of nodes.
The tree is given in level-order (TreeNode with { val, left, right }, null for a missing child).
[3,1,4,null,2], 1[5,3,6,2,4,null,null,1], 3[2,1,3], 2[1], 1[3,1,4,null,2], 4[5,3,6,2,4,null,null,1], 6