Stripe interview question

String and Array manipulation followed by graph.