Jenius Bank interview question

Was asked a string manipulation question in HackerRank