Plz correct this

@devwrath1999 You were not updating your mid element for every iteration as you were defining it outside the loop so that is why the answer was wrong .

Declare the mid element inside the element and the code should work all right

Hope it helps :blush: .
If your doubt is now resolved please mark it as resolved and rate me accordingly .
Else you can further questions here .
Thankyou