Link :-https://practice.geeksforgeeks.org/problems/maximum-path-sum/1
Can you pls explain me the concept of how to proceed in this question
this is the same question as that of finding Diameter of tree
in this question you have to calculate diameter of tree
and in your course there is a video for that under Binary Tree section
No i still cannot be able to understand how it can be diameter of tree may be the node values are much bgger in another path sosum might be bigger .So please explain again
Yes you are correct
but the approach will remain same as that of diameter’s question
here instead of subtree height and diameter you return max_sum and subtree sum
try once then i will provide you the code
Reference Code
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.