题解 | #左旋转字符串#
左旋转字符串
https://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec
class Solution { public: string LeftRotateString(string str, int n) { if(str.size()==0) { return str; } string s1; float m=0.0; m=n%str.size(); if(m==0.0) { return str; } s1.append(str,0,m); string s2; s2.append(str,m,str.size()-m); s2.append(s1,0,s1.size()); return s2; } };