当前位置:网站首页>[leetcode] 577 reverse word III in string
[leetcode] 577 reverse word III in string
2022-07-02 15:36:00 【Crisp ~】
Given a string s , You need to reverse the character order of each word in the string , Keep the initial order of spaces and words .
Example 1:
Input : s = “Let’s take LeetCode contest”
Output : “s’teL ekat edoCteeL tsetnoc”
Example 2:
Input : s = “God Ding”
Output : “doG gniD”
Tips :
- 1 <= s.length <= 5 * 104
- s Include printable ASCII character .
- s Does not contain any beginning or ending spaces .
- s in At least There's a word .
- s All words in the are separated by a space .
# String segmentation , Reverse one by one , Merge
class Solution(object):
def reverseWords(self, s):
return " ".join([word[::-1] for word in s.split()])
边栏推荐
- How does the computer set up speakers to play microphone sound
- 13_Redis_事务
- 12_ Redis_ Bitmap_ command
- [network security] network asset collection
- 20_ Redis_ Sentinel mode
- 16_ Redis_ Redis persistence
- How to find a sense of career direction
- Yolo format data set processing (XML to txt)
- How to avoid 7 common problems in mobile and network availability testing
- PTA 天梯赛习题集 L2-001 城市间紧急救援
猜你喜欢

Build your own semantic segmentation platform deeplabv3+

【LeetCode】1162-地图分析

15_ Redis_ Redis. Conf detailed explanation

FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)

. Solution to the problem of Chinese garbled code when net core reads files

5. Practice: jctree implements the annotation processor at compile time

02_线性表_顺序表

vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)

21_ Redis_ Analysis of redis cache penetration and avalanche

Bing.com網站
随机推荐
05_ queue
21_Redis_浅析Redis缓存穿透和雪崩
Bing.com网站
21_ Redis_ Analysis of redis cache penetration and avalanche
Yolo format data set processing (XML to txt)
02. After containerization, you must face golang
XML Configuration File
folium,确诊和密接轨迹上图
Semantic segmentation learning notes (1)
4. Jctree related knowledge learning
Leetcode skimming -- count the number of numbers with different numbers 357 medium
FPGA - clock-03-clock management module (CMT) of internal structure of 7 Series FPGA
Wechat Alipay account system and payment interface business process
4. Data splitting of Flink real-time project
【LeetCode】19-删除链表的倒数第N个结点
语义分割学习笔记(一)
20_Redis_哨兵模式
17_Redis_Redis发布订阅
Pytorch 保存tensor到.mat文件
密码学基础知识