Leetcode学习(6)—— Reverse Words in a String III
2017-05-06 00:02
393 查看
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
Note: In the string, each word is separated by single space and there will not be any extra space in the string.
思路:用空格拆分字符串,反转每一个单词,再 join 成一个新的字符串
![](https://img-blog.csdn.net/20170506000238125?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSGVhdERlYXRo/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
Input: "Let's take LeetCode contest" Output: "s'teL ekat edoCteeL tsetnoc"
Note: In the string, each word is separated by single space and there will not be any extra space in the string.
思路:用空格拆分字符串,反转每一个单词,再 join 成一个新的字符串
相关文章推荐
- leetcode557. Reverse Words in a String III
- leetcode 557.:Reverse Words in a String III
- LeetCode——557. Reverse Words in a String III
- leetcode 557 Reverse Words in a String III C++
- 【LeetCode】557 Reverse Words in a String III
- Leetcode——557. Reverse Words in a String III
- leetcode 557 Reverse Words in a String III
- LeetCode之Reverse Words in a String III
- LeetCode 557 Reverse Words in a String III(逆转字符串)
- Leetcode557. Reverse Words in a String III
- LeetCode Reverse Words in a String III
- leetcode Reverse Words in a String III 反转字符串中的单词
- leetcode-Reverse Words in a String III
- 字符串-leetcode 557 Reverse Words in a String III
- leetcode557——Reverse Words in a String III
- Reverse Words in a String III(leetcode)
- leetcode[Reverse Words in a String III]//待整理多种解法
- Leetcode 557 Reverse Words in a String III
- leetcode解题报告(25):Reverse Words in a String III
- leetCode---Reverse Words in a String III