Kth Smallest Number in a Binary Search Tree
Medium
Given the root of a binary search tree (BST) and an integer k, find the kth smallest node value.
Example:
Output: 6
Constraints:
n ≥ 1, wherendenotes the number of nodes in the tree.1 ≤ k ≤ n