Stripe interview question

To solve the string problem