Pergunta de entrevista da empresa Aristocrat

Reverse words in a string , generate all permutations of a string.