Stripe interview question

A coding question regarding string manipulation.