JPMorganChase interview question

String manipulation & array pure functions