题解 | #字符串的排列#
左旋转字符串
http://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec
切片轻松搞定
function LeftRotateString(str, n) { // write code here if(!str) return ""; n = n % str.length; let res = str.slice(n,str.length) + str.slice(0,n); return res; } module.exports = { LeftRotateString : LeftRotateString };