Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
PS: 今天题目不算难,一种方法是用栈,是 O(n)的复杂度,看看各位有什么巧妙的方法吧。
For example,
Given s = "the sky is blue",
return "blue is sky the".
PS: 今天题目不算难,一种方法是用栈,是 O(n)的复杂度,看看各位有什么巧妙的方法吧。