Domanda di colloquio di Deloitte

they asked me to code a question based on array