Whats wrong in this code

although passing all testcase

hi @Mihir163

you forgot to update your root after deletion
correct one
for(int i=0;i<n2;i++)
{
root=deleteBST(root,arr2[i]);
}