Pergunta de entrevista da empresa Gemini Systems

easiest way to reverse the string, example: "today is Monday" to "Monday is today"

Respostas da entrevista

Sigiloso

15 de abr. de 2012

1. reverse the entire string 2. reverse each word

1

Sigiloso

19 de fev. de 2013

Parse the string into an array using space as divider. Array contains {today, is, Monday} In a for loop, go through the array from end to beginning, forming your reversed string.