Stripe Interview Question

An array problem, not hard