557. 反转字符串中的单词 III
https://leetcode-cn.com/problems/reverse-words-in-a-string-iii/
解法一:c++STL
思路:善用c++STL的reverse模板算法.
解法二:py
将s按空格split成列表words,然后对words每个元素反转存在reverse中。
然后用join函数连接reverse中元素。
最后更新于
https://leetcode-cn.com/problems/reverse-words-in-a-string-iii/
思路:善用c++STL的reverse模板算法.
将s按空格split成列表words,然后对words每个元素反转存在reverse中。
然后用join函数连接reverse中元素。
最后更新于