Wrong TestCase, Wrong Answer, BSTOPS, BST Operation

Can any one help what’s wrong in my code i have tried my best but not got.
After lots of try i simply copied the functions from geeks for geeks and then only made changes to print index.

Hey @avishek_pratap,

Because of the deletion operation, the positions of elements might change and this may lead to elements having value other than their position. This has not been taken care in your approach, since while deleting you print the position of the element and not its value.

Consider the following case
Input:
i 1
i 2
i 4
d 2
d 4
Your output:
1
3
7
3
3
Expected Output:
1
3
7
3
7

Deleting the element 4 should print 7, and not 3.

Thanks a lot bro @rahulladda . I don’t know how can i miss such an important information, it is also written separately in question but i missed.

No issues @avishek_pratap, but make sure you have put enough effort in debugging the solution before posting it on the forum.
You can go through other accepted solutions too. Honestly, that is what I did to debug your code.