Frage im Vorstellungsgespräch bei Stripe

Multi part question on strings, array manipulation which got complex with every subsequent part