07.07 · Problem
Lowest Common Ancestor of a BST
This problem is part of solulu Pro
Given a binary search tree and two of its nodes p and q, return their lowest common ancestor — the deepest node that has both p and q as descendants (a node counts as a descendant of itself). In the tests, p and q are…
Lifetime ₹1,999 ₹999 · Launch offer
Item 52 of 150 · updated 2026-10-12