Problem 235 · Medium

Lowest Common Ancestor of a Binary Search Tree

Walk down: if both nodes are smaller go left, both larger go right; split point is the LCA.

Open the interactive visualisation