Build BST (Binary Search Tree)

pls help…I have written the code and it is showing successful compilation but not giving any output.
code:

Hello @GreatCoderboy123,

Your code is logically correct.
There might be some issue with the IDE.
For now, you may use some other IDE:
https://ide.geeksforgeeks.org/LJZoDe212T

Hope, this would help.
Give a like if you are satisfied.

How do I submit my code idf the ide is not working?

I submitted my code and it is giving wrong answer in all test cases

Hey @GreatCoderboy123,

This is because there is a silly mistake in your code.
I have corrected it:


Refer to the comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.