Pergunta de entrevista da empresa FactSet

Given an arraylist, reverse the first n elements and print the entire arraylist.