当前位置:网站首页>剑指offer 第 3 天字符串(简单)
剑指offer 第 3 天字符串(简单)
2022-06-25 12:19:00 【辞树 LingTree】
剑指 Offer 05. 替换空格https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/
class Solution {
public String replaceSpace(String s) {
String str = s.replace(" ", "%20");
return str;
}
}
剑指 Offer 58 - II. 左旋转字符串https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/
class Solution {
public String reverseLeftWords(String s, int n) {
String a = s.substring(0, n);
//System.out.println(a);
String b = s.substring(n, s.length());
//System.out.println(b);
String str = b + a;
//System.out.println(s);
return str;
}
}
边栏推荐
- Visual studio2019 link opencv
- JS array length is defined
- yolov5训练使用的负样本图片
- Figure explanation of fiborache sequence
- Idea2017 how to set not to automatically open a project at startup
- 量化交易之回测篇 - 期货CTA策略策略(TQZFutureRenkoWaveStrategy)
- GPS NMEA protocol, 0183 positioning data format dual mode positioning: gnxxx gps+bd full version
- 百度搜索稳定性问题分析的故事
- JS uses the for loop in the function to insert and delete the array at the specified position
- The drop-down box renders numbers instead of the corresponding text. How to deal with it
猜你喜欢
线上服务应急攻关方法论
Idea2017 how to set not to automatically open a project at startup
It is extraordinary to make a move, which is very Oracle!
QT TCP UDP network communication < theory >
Common colors for drawing
Meichuang was selected into the list of "2022 CCIA top 50 Chinese network security competitiveness"
(6) Pyqt5--- > window jump (registration login function)
最大数[抽象排序之抽象规则]
C program linking SQLSERVER database: instance failed
AI assisted paper drawing of PPT drawing
随机推荐
list.replace, str.append
Select randomly by weight [prefix and + dichotomy + random target]
JS SMS countdown implementation (simple code)
Using CMD (command prompt) to install MySQL & configure the environment
Common colors for drawing
node. JS architecture optimization: reverse proxy and cache service
更新pip&下载jupyter lab
The push(), pop(), unshift(), shift() method in the JS array
MySQL writes user-defined functions and stored procedure syntax (a detailed case is attached, and the problem has been solved: errors are reported when running user-defined functions, and errors are r
Matlab simulation of m-sequence
Ramda rejects objects with null and empty object values in the data
nacos无法修改配置文件Mysql8.0的解决方法
STM32 stores float data in flash
20220620 面试复盘
Parse JSON format data and save it to entity class
JS function exercises
1251- Client does not support authentication protocol MySql错误解决方案
Geospatial search - > R tree index
515. Find Largest Value in Each Tree Row
Slice() and slice() methods of arrays in JS