左旋转字符串-python

思路:左移n位就是把前n位移动到字符串后面去

# -*- coding:utf-8 -*-
class Solution:
    def LeftRotateString(self, s, n):
        # write code here
        return s[n:] + s[:n]
posted @ 2019-08-10 18:52  Dolisun  阅读(364)  评论(0编辑  收藏  举报