NatWest Group interview question

String manipulation and arrays manipulation