Stripe Interview Question

String parsing problem. They don't expect optimization so just go for brute force.