题解 | #左旋转字符串#
左旋转字符串
http://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec
function LeftRotateString(str, n)
{
// write code here
if(!str || n>=str.length) {
if(!str) {str = ''}
return str
}
var arr = [str.slice(0, n), str.slice(n)]
return arr.reverse().join('')
}
module.exports = {
LeftRotateString : LeftRotateString
}; 

