In this problem - https://www.codechef.com/submit/BSTOPS.
For deletion operation do we need to print 2 positions -
- node which is deleted
- node which is replacing deleted node . (when node to be deleted has at least one child).
Accepted answer expects two positions if node has at least one child. But its not clear in description.
Even If we need to print two positions there will be different answers, because I can replace node with maximum in left sub tree or minimum in right sub tree.
But only one answer gets accepted.
This is causing lot of confusion.
Output1 - Replacing with Minimum in right sub tree of node.
Output2 - Replacing with Maximum in right sub tree of node.