Can someone please explain me the first approach?

The problem is Rearrange array alternatively, here is the link to the problem. I am not understanding the first approach of the problem. Can anyone please help me with that? Thanks! :slightly_smiling_face: