当前位置:网站首页>剑指Offer(四十三):左旋转字符串
剑指Offer(四十三):左旋转字符串
2022-07-26 10:36:00 【康斯坦奇】
解法1:简单方法,直接字符拼接
class Solution:
def LeftRotateString(self, s, n):
# write code here
new1 = s[:n]
new2 = s[n:]
new = new2 + new1
return new
边栏推荐
- Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL
- Parallelism, concurrency and several directions for high concurrency optimization
- .net5wtm (asp.net core) PgSQL unpacking operation
- 构造器、方法重载、对象数组和static
- Redis特殊数据类型使用场景
- 结构体操作报错:Segmentation fault (core dumped)
- L2-005 set similarity (intersection of vector and set)
- 父类对子类的引用(父类引用指向子类对象)
- Zongzi battle - guess who can win
- 2022pta usual training questions (1-10 string processing questions)
猜你喜欢
随机推荐
Structure of [Halcon vision] operator
L2-005 set similarity (intersection of vector and set)
.NET操作Redis Set无序集合
Using native JS to realize custom scroll bar (click to reach, drag to reach)
11 在 operator= 中处理“自我赋值”
Redis Docker实例与数据结构
记给esp8266烧录刷固件
STM32 Alibaba cloud mqtt esp8266 at command
数据库函数
Unit test, what is unit test and why is it so difficult to write a single test
[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间
Phase 4: one of College Students' vocational skills preparation in advance
MLX90640 红外热成像仪测温传感器模块开发笔记(六)红外图像伪彩色编码
[Halcon vision] software programming ideas
Analyze the hybrid construction objects in JS in detail (construction plus attributes, prototype plus methods)
.net operation redis list list
404页面和路由钩子
[Halcon vision] array
10 令 operator= 返回一个 reference to *this
The problem of large fluctuation of hx711 data