This video was great why? Cause you connected the dots between two concepts and apply it here clearing all the thought processes.. Thank you , your videos are truly helping me in getting better at leetcode problem solving and I can see my results while solving, thinking and approaching problem
My approach was slightly different but i think the underlying intuition is the same. Basically find the centroid of both the graphs. From the centroid, do DFS to find the 2 largest heights (their sum would result in the diamater of the respective tree) and the combined diameter would be sum of the largest height of each tree + 1. We would then take minimum of these values.
Why we cannot use median method , it is giving me wrong answer on 453 test case , if i just join two medians of different trees , please reply @ARYANMITTAL
you will need to track individual diameter of both the trees it could be the case that by joining two medians the path length is still smaller than any one of the two diameters
I guess this one was easier than Problem 3, what do you guys think?
Uber Interview on LLD-HLD Channel - ruclips.net/video/VGYJIX5yl74/видео.html
same
Only problem here was to come up with an algo for Diameter 💀💀.
Did not get this intuition of using one extreme to another extreme
yess
Have you gone crazy to go about privatising every video of your channel
This video was great why? Cause you connected the dots between two concepts and apply it here clearing all the thought processes.. Thank you , your videos are truly helping me in getting better at leetcode problem solving and I can see my results while solving, thinking and approaching problem
My approach was slightly different but i think the underlying intuition is the same. Basically find the centroid of both the graphs. From the centroid, do DFS to find the 2 largest heights (their sum would result in the diamater of the respective tree) and the combined diameter would be sum of the largest height of each tree + 1. We would then take minimum of these values.
nice explanation bro
🥰
My solution failed exactly on the "edge" case mentioned, it cleared my doubt why the answer is 7. Thanks!!!
why soln giving TLE
Why we cannot use median method , it is giving me wrong answer on 453 test case , if i just join two medians of different trees , please reply @ARYANMITTAL
you will need to track individual diameter of both the trees it could be the case that by joining two medians the path length is still smaller than any one of the two diameters
@@nutrinoflash6132 But how it can be , if am taking median , shoudln't the height is eqaul to half of diameter?
Overkill
@@tirthpatel-t6u ceil(x/2) + ceil(y/2) + 1
please make video on leetcode 3202
Done 🫡🤌🏻
No Vedio on 1,2,3 ?
Already live on channel sir🫡😮💨
this solution gives tle , idk y