Domanda di colloquio di Nagarro

Javascript arrays and a problem to solve a array coding question.