If in the 2nd example of video we have 200 and its children as -50 and -100 . (Instead of -200 with children 50 and 100) . What will we return to 30 ? 200 or 150?
Doubt in example
hello @vishakha_narang
we will return -100 to 30.
because -200 is the node and if we inlcude 100 then we get -100
and if we include 50 then we get -150 , since -100 is maximum we return this to parent(30)
I am asking for 200 with children -50 and -100 not -200 with 50 and 100
return 200 only, no need of considering child since they are negative and will reduce the overall result
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.