Pergunta de entrevista da empresa Samsung India Electronics

Algorithm to improve reversal of words in a string in c++ and python both