Medium
Find the kth smallest value in a BST.
Given the root of a binary search tree and an integer k, return the kth smallest node value.
Examples
Input: root = [3,1,4,null,2], k = 1
Output: 1
Constraints
- 1 <= k <= number of nodes
Coding Challenge
Find the kth smallest value in a BST.
Given the root of a binary search tree and an integer k, return the kth smallest node value.
Input: root = [3,1,4,null,2], k = 1
Output: 1
Preparing your coding workspace...