Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
一刷:
如果是in-place的替换,思路不那么容易想到。首先全部reverse, 然后再局部每个单词reverse
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
一刷:
如果是in-place的替换,思路不那么容易想到。首先全部reverse, 然后再局部每个单词reverse