Getting error in the code

i am getting run error. please help https://ide.codingblocks.com/s/240731

Hey @ayusdas2000 you can check my personalise code to check concept as your card is hard to debug https://ide.codingblocks.com/s/295447
Moreover don’t submit the same , it’s just for your reference as in this code I haven’t declared global tree intentionally. This might help you :slight_smile:

even your code is giving run error.

It’s giving error or run time error?

it is giving run time error

Yes because I made it intentionally, reason is cause I

Just keep it for reference purpose.

i already know concept, from the hint and coded it too. but could not find exactly why i am getting run error. and what exactly is that error. this time i recommented my code. please help me find out the error. https://ide.codingblocks.com/s/240731

Okay I’ll debug it for you, give me some time. Till then you can do your next question. I’ll let you know when I’ll debug it :grinning:

Hey @ayusdas2000 I have seen debug your code. Why you are getting run time error is because you are not declaring your tree as global. Because of that you are initialising it multiple times. Just make it global and all your test cases will be passed :slight_smile: