Ifyouwanttotrysolvingthisproblemyourself, Pulis a videorighthereandseeifyoucancomeupwith a solutionon.
Comebacktothevideolater.
There's a numberofsolutionstothisproblem, buttheone I findthesimplestisthefollowing.
Let's saywe'retryingtofindthe L C A.
Thatlowestcommonancestorofffourandfive.
What I woulddofirstis I wouldfindthepastfromtheroottooneoftheelementsforLet's say I dothatbygoingtotheleftandthenleftagainonrightthere I findtheelement.
Sothepasttothatlemonwouldbe 14134 on.
I woulddothesamethingwithfive.
So I startedtherouteagain.
13 totheleftonfiveisnotthere.
So I gototheright, leftagainand I findthepaths.
Sothat's 13 65 onByexaminingthesetwopaths 134 on 1365 Weseethatthesetwopathsarethesameupon 23 convertordiversafterthat.