👇公众号👇---👇 微信 👇
欢迎大家私信&加群交流
Appearance
示例 1: 输入: s = "abcdefg", k = 2 输出: "cdefgab" 示例 2: 输入: s = "lrloseumgh", k = 6 输出: "umghlrlose"
解法1:直接使用剪切字符串API
/** * @param {string} s * @param {number} n * @return {string} */ var reverseLeftWords = function (s, n) { return s.slice(n)+s.slice(0,n) };
题链