Amazon interview question

Shortest distance between two node of binary search tree.

Interview Answer

Anonymous

11 Aug 2023

I solved using LCA concept of tree. Distance will be sum of distance from LCA node of both nodes.