Stripe Interview Question

String and Array manipulation followed by graph.