Tokopedia interview question

HackerRank (string manipulation and array)