Pregunta de entrevista de Uncountable

Some string manipulation problem. Probably leetcode easy or medium