当前位置:网站首页>剑指 Offer 05. 替换空格
剑指 Offer 05. 替换空格
2022-06-25 15:32:00 【anieoo】
原题链接:剑指 Offer 05. 替换空格

solution:
一次遍历即可
class Solution {
public:
string replaceSpace(string s) {
string res;
for(auto &x : s) {
if(x == ' ') res += "%20";
else res += x;
}
return res;
}
};边栏推荐
- Using reentrantlock and synchronized to implement blocking queue
- Image segmentation based on deep learning: network structure design
- Websocket (WS) cluster solution
- Boost listening port server
- QT loading third-party library basic operation
- System Verilog - function and task
- Judging the number of leap years from 1 to N years
- Efficient pytorch: how to eliminate training bottlenecks
- Paddlepaddle paper reproduction course biggan learning experience
- Reflection - learning notes
猜你喜欢

Solution of push code failure in idea

Source code analysis of synergetics and ntyco
![[paper notes] overview of case segmentation](/img/93/57ad42e0c058b7d5fd1b4066678707.jpg)
[paper notes] overview of case segmentation

Yolov4 coco pre train Darknet weight file

CPU over high diagnosis and troubleshooting

Arthas source code learning-1

Several common optimization methods

1090.Phone List

Graphic control and layout basis of R visualization

Common dynamic memory errors
随机推荐
System Verilog — interface
Go language template text/template error unexpected EOF
2.18 codeforces supplement
5 connection modes of QT signal slot
Qlogsystem log system configuration use
[C language] 32 keyword memory skills
Semaphore function
1090.Phone List
Basic syntax and common commands of R language
Some usage records about using pyqt5
Solve the go project compilation error go mod: no such file or directory
The difference between sizeof and strlen
Reflection - learning notes
Luogu p5707 [deep foundation 2. example 12] late for school
Data preprocessing - normalization and standardization
Yolov4 coco pre train Darknet weight file
Design and implementation of thread pool
Websocket (WS) cluster solution
QT pattern prompt box implementation
[paper notes] contextual transformer networks for visual recognition