Implement a function to calculate the lowest common ancestor in a binary search tree.
HardProblem Statement
Implement a function to calculate the lowest common ancestor in a binary search tree.
Sample Input
Tree: 6 / \ 2 8 / \ / \ 0 4 7 9 Nodes: 2 and 8
Sample Output
Lowest Common Ancestor: 6
Limits
Time: 2s · Memory: 256 MB