Pregunta de entrevista de PayPal

Two coding questions - basic logic and arrays