Question d’entretien chez Deloitte

they asked me to code a question based on array