Difficulty | Tags | Solution Link |
---|---|---|
Medium | [Recursion, Strings] | Here |
Write a function reverseSentence
that receives a sentence and returns the sentence in reverse order. Assume the sentence doesn't have any punctuation or special characters.
Example
reverseSentence("Hello World"); // returns "World Hello"
reverseSentence("it was the best of times it was the worst of times");
//returns "times of worst the was it times of best the was it"