I have tried to code this along the video but I am not getting right answer. Can you tell me where I am making mistake?My Code is : https://ide.codingblocks.com/s/219666
Maximum Sum Path In a Binary Tree Implementation
@gourav
The mistake is you are printing the value that is returned from the funtion, which is just a temporary answer that needs to returned to its parent.
But the actual answer can be different.
So just print “s.globalMaximum”, according to your code.
1 Like