Brain Station-23 interview question

The coding test was fairly easy, they gave some string and array based questions