当前位置:网站首页>剑指 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;
}
};边栏推荐
- Generic - learning notes
- One question per day,
- System Verilog - thread
- Efficient pytorch: how to eliminate training bottlenecks
- Character encoding minutes
- [C language] 32 keyword memory skills
- QT set process startup and self startup
- [C language] implementation of magic square array (the most complete)
- Summary of regularization methods
- Solution of push code failure in idea
猜你喜欢

Qcodeeditor - QT based code editor

Yolov4 coco pre train Darknet weight file

Postman usage notes, interface framework notes
![[paper notes] street view change detection with deconvolutional networks](/img/2d/777fd0d85ff4d349516b95923410fd.jpg)
[paper notes] street view change detection with deconvolutional networks

Arthas, a sharp tool for online diagnosis - several important commands

google_ Breakpad crash detection

CPU over high diagnosis and troubleshooting

Learning notes on February 8, 2022 (C language)

Introduction to flexible array

Dynamic memory allocation
随机推荐
[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3
Generation method and usage of coredump
How to download and install Weka package
(translation) json-rpc 2.0 specification (Chinese version)
Basic syntax and common commands of R language
Esp8266 building smart home system
Qmake uses toplevel or topbuilddir
QT source code online view
Review of arrays and pointers triggered by a topic
2. operator and expression multiple choice questions
QT excel table read / write library - qtxlsx
Graphic control and layout basis of R visualization
通过客户经理的开户链接开股票账户安全吗?
The last glory of the late Ming Dynasty - the battle of Korea
AB string interchange
Business layer - upper and lower computer communication protocol
Summary of common methods of ArrayList, LinkedList and vector, and analysis of source code learning
If a thread overflows heap memory or stack memory, will other threads continue to work
Bessie's weight problem [01 backpack]
Netlogo learning