PayPal interview question

Two coding questions - basic logic and arrays