Kth Smallest Element in a BST

IF
AlgoAxiomStaff Engineers
JSTS
Medium20 mins

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

Source: Tree Depth-First Search pattern — AlgoAxiom
JavaScript
Test Case 1
root = [1, 2, 3]
Test Case 2
root = [1, 2, 3, 4, 5]
Idle