Pregunta de entrevista de Samsung India Electronics

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