Replace with Sum of greater nodes

i am not able to figure out the error in my code
here is my code -https://ide.codingblocks.com/s/327826

Made changes in ur code: