Kth Smallest Element in a BST
Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.
Kth Smallest Element in a BST

Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.

Example 1:
Input: {"root":[3,1,4,null,2],"k":1}
Output: 1
Input
arr ={"root":[3,1,4,null,2],"k":1}

Init stack

3

1

4

2

Variables
No variables to display
DepthFunction Call
Stack empty
0/8