Still Maximum Hackerearth

Getting correct answer on sample only
My code->https://ide.geeksforgeeks.org/ERT7RgXW6a 1
help!!

@Bhawna could me send me question link and sample inputs so that i can run and check your code.

at every step you are changing special value with current max[root]-min[root] but you should compare it with previous special value and if it is greater than previous special value then update it.
i have commented important updates in your code look into it for more clarity https://ide.codingblocks.com/s/383638

solved now…

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.