Pergunta de entrevista da empresa Capgemini

in a given string reverse only the selected word and reverse the those