Wrong answer in 2 test cases

https://hack.codingblocks.com/contests/c/511/474?_ga=2.229237276.1661448070.1550406484-1721200315.1546842346
https://ide.codingblocks.com/s/56794

help here please…

Algo is correct…check build function!

unable to debug in build function…
help here please…

help here please…

Hey Gaurav, your build() is not correct, here I have updated your code by using an another function for constructing the tree, you can refer this.

I am not able to understand this code please debug my own code

please debug this build function please

help here please…

Hey, I have debugged your code only in this, your insert() was wrong and I have corrected that.

thanks alot…