Pergunta de entrevista da empresa Tata Consultancy Services

They asked how to reverse an array