Solución
solution.tsTypeScript
function rotateLeft(str: string, pos: number): string {
let mod = pos % str.length
return str.length >= pos ? str.slice(pos) + str.slice(0, pos) : str.slice(mod) + str.slice(0, mod);
}
// No modificar: necesario para evaluar el resultado.
export { rotateLeft };
0respuestas