Stripe interview question

To complete a hackerrank challenge.