题解 | #左旋转字符串#
左旋转字符串
http://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec
我爱JS
function LeftRotateString(str, n)
{
// write code here
if(!str) return ""
let mod=n%str.length
let a = str.slice(0,mod)
return str.slice(mod).concat(a)
}
module.exports = {
LeftRotateString : LeftRotateString
};