题解 | #左旋转字符串#
左旋转字符串
https://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec
function LeftRotateString(str, n)
{
// write code here
if(!str) return "";
for(let i = 0; i < n; i++){
str = str.slice(1) + str[0]
}
return str;
}
module.exports = {
LeftRotateString : LeftRotateString
};
