I can't understand the loop pattern given in the solution

Is this your code or the solution code?

the solution, given in the editorial

Inside which function is the loop you cannot understand?

I understood. Thank you!

please close the doubt then