当前位置:网站首页>[leetcode] sword finger offer 58 - ii Rotate string left
[leetcode] sword finger offer 58 - ii Rotate string left
2022-07-21 01:54:00 【Spring-_- Bear】
The left rotation operation of string is to transfer several characters in front of string to the end of string . Please define a function to implement the left rotation operation of string . such as , Input string "abcdefg" And number 2, This function will return the result of rotating two bits to the left "cdefgab".
Example 1:
Input : s = “abcdefg”, k = 2
Output : “cdefgab”
Example 2:
Input : s = “lrloseumgh”, k = 6
Output : “umghlrlose”
Limit :
1 <= k < s.length <= 10000
/** * The finger of the sword Offer 58 - II. Left rotation string */
public String reverseLeftWords(String s, int n) {
return s.substring(0, n) + s.substring(n);
}
source : Power button (LeetCode)
link :https://leetcode.cn/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof
边栏推荐
- 【腾讯位置组件】 微信公众号h5 调用腾讯地图组件
- 华为员工爆料,这个岗位要开始大量招人了!!!
- 力扣刷题记录4-----69. x 的平方根
- 通过例子学C标准库<assert.h>
- [03] let's talk about "performance" through your CPU frequency?
- JVM tuning method
- 10 port scanning tools for advanced scanning by network administrators
- [LeetCode]剑指 Offer 58 - II. 左旋转字符串
- How to use mitmproxy to get data return in automated testing?
- It's 2022, and you don't know what automated testing is
猜你喜欢
干货丨重中之重:数据分析中常用指标及术语!
JASMINER X4在海外爆红,获众多知名博主点赞认可
力扣刷题记录1-----704.二分查找
Go daily Gore
NetFlow and SNMP are two different network monitoring methods
Unity shader 实现图片带圆角和边线border
[03] let's talk about "performance" through your CPU frequency?
At32 uses the kernel DWT register to set the delay time
ICLR 2022 | gnnaskernel: a general framework that can improve the expression ability of any GNN
使用OpenCV调整图像的亮度和对比度
随机推荐
【R语言文本挖掘】:情感分析与词云图绘制
A good resume can always brighten people's eyes during the interview of the testing post
买服务器需要看哪些参数,如何看服务器配置
第九天(抓取流量、路由策略)
LeetCode. 558. Intersection of quadtrees___ Divide and conquer
LVS cluster application
0.0. Pytorch model building method
【AD学习记录】覆铜
超分领域常见的损失函数
20元一支的洗面奶,7天卖了上万,他们是如何做到的?
美国议员倡导打击加密挖矿 敲响加密警钟?减少碳足迹才能发挥真正价值
Redis 主从复制&哨兵模式
Win:使用 netsh 命令配置 Port Forwarding
面试题复习2
机器学习笔记 - 构建推荐系统(4) 用于协同过滤的矩阵分解
【腾讯位置组件】 微信公众号h5 调用腾讯地图组件
函数方法封装——图片类型QPixmap、QImage与Mat的相互转化
计算任意根号n的值
【NOI模拟赛】思门弄数(数论,链表)
C语言入门实战(9):完数判断