Pergunta de entrevista da empresa Tata Consultancy Services

How to reverse an array based on another array