Pergunta de entrevista da empresa Microsoft

Invert the words of a sentence in a string.

Respostas da entrevista

Sigiloso

18 de out. de 2017

Split the string by space into an array of strings, then use new StringBuilder("your string here").reverse().toString() to reverse each individual word. Append each word to a stringbuilder and add a space in between words, if you're on the last word append "" instead.

Sigiloso

18 de out. de 2017

If you want to reverse the order of the words just apppend them backwards instead