Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 805 Bytes

ReverseSentence.md

File metadata and controls

15 lines (11 loc) · 805 Bytes

Recursive Reverse Sentence

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"