Pregunta de entrevista de Accenture Solutions

2 coding questions based on array