Test cases going wrong

Test cases giving incorrect answer despite correct compiler response

please do this question with the help of for loop .your anwswer is coming wrong with this approach .
it is the basic question just for checking your knowledge about break statement and loops .
your answer is coming out to be wrong because your iterator are not pointing to the correct locations .
here is the link for the prateek bhaiya’s video for the better understanding of the concept.
https://www.youtube.com/watch?v=3J1tAsoZ7-g.

and you should do the dry run of the code in order to understand where yor code is doing wrong .see this: