#235

Lowest Common Ancestor of a Binary Search Tree

medium· Treesruns: 0

Given a binary search tree, find the lowest common ancestor (LCA) of two given nodes p and q in the BST. The LCA is the lowest node in the tree that has both p and q as descendants, where a node can be a descendant of itself.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.