code is:
i sorted the bst in ascending order.
then deleted those elements which needed to be deleted…then arranged the tree in bst form (using the formation of a bst by division from the middle)and printed the preorder…it is giving the correct answer for the given input but showing wrong answer for all other cases…it should have given TLE but it is giving wrong answer…can anyone please help out in finding error in this logic?