Stripe Interview Question

To solve the string problem