[0186] 翻转字符串里的单词 II
- GitHub
- http://leetcode.xuezhisd.top/post/7de303b4.html
- https://leetcode.com/problems/reverse-words-in-a-string-ii
- https://leetcode-cn.com/problems/reverse-words-in-a-string-ii
题目描述
给定一个字符串,逐个翻转字符串中的每个单词。
示例:
输入: ["t","h","e"," ","s","k","y"," ","i","s"," ","b","l","u","e"] 输出: ["b","l","u","e"," ","i","s"," ","s","k","y"," ","t","h","e"]
注意:
- 单词的定义是不包含空格的一系列字符
- 输入字符串中不会包含前置或尾随的空格
- 单词与单词之间永远是以单个空格隔开的
进阶:使用 O(1) 额外空间复杂度的原地解法。
Related Topics
题目解析
- [请一句话描述题目…]
不确定性
方法一:[算法名称]
分析
思路
注意
知识点
复杂度
代码
1 | // |
方法二:[算法名称]
分析
思路
注意
知识点
复杂度
代码
1 | // |