Skip to main content
DevHives

Lowest Common Ancestor in a BST

Loading editor…

3 examples run when you press Run. Submit checks every hidden test too.

Case 1
Input:
[40,20,60,10,30,50,70], 10, 30
Expected:
20
Case 2
Input:
[12,5,18,2,9,15,25,null,null,7], 5, 7
Expected:
5
Case 3
Input:
[8,3,11], 11, 11
Expected:
11
Ready

Run checks your code against the 3 examples. Submit checks it against all 153 tests and needs a free account. You can also try ideas in the free JavaScript or Python compiler.