剑指offer58左旋字符串

# coding:utf-8
"""
Name : 剑指offer58.py
Author  : qlb
Contect : 17801044486@163.com
Time    : 2021/2/7 14:14
Desc: 左旋字符串
"""

class Solution:
    def reverseLeftWords(self, s: str, n: int) -> str:
        s = list(s)
        s = s[n:] + s[:n]
        return ''.join(s)

 

posted @ 2021-02-07 17:21  qilibin  阅读(30)  评论(0编辑  收藏  举报