Please correct my code. It’s giving wrong answer
Replace with Sum of Greater Nodes
@minal.251298,
You are not updating the root after constuction.
Do this.root =this.construct(arr, 0, arr.length - 1); instead of just this this.construct(arr, 0, arr.length - 1);