Stripe Interview Question

string manipulation question and some followups