[LeetCode] Depth of BST Given Insertion Order

1 · · Aug. 15, 2022, 10:32 a.m.
1902. Depth of BST Given Insertion Order You are given a 0-indexed integer array order of length n, a permutation of integers from 1 to n representing the order of insertion into a binary search tree. A binary search tree is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node contains only nodes with keys greater than the node’s key. Both the left and right subtrees must also be binary search trees. The binary sear...