Rica Tech interview question

What is the logic to reverse the array