How would you reverse the words in a string?
Anonimo
Questions to ask: Do you want the entire string in reverse order (This is a plum => mulp a si sihT)? Do you want the words in reverse order (This is a plum => plum a is This)? Do you want the words reversed but in the same order (This is a plum => sihT si a mulp)? The first one just use the language's built on reverse string function. If they are demanding that you reinvent the wheel by rolling your own, look it up before you go in for the language they want you to use. For the middle one move the words into an array of strings then reassemble back into a string in reverse order. For the last one move the words into an array of strings then reverse the sub arrays and reassemble back into a string.