Getting wrong output

Hey @ayushi1150

int mid = 0;//updated

Rest everything is good. you can submit it and see.