Visa Inc. interview question

String manipulation leet code question