Solución
solution.tsTypeScript
function rotateLeft(str: string, positions: number): string {
// Tu código aquí
const arr = str.split("");
for (let i = 0; i < positions; i++) {
arr.push(arr.shift());
}
return arr.join("");
}
// No modificar: necesario para evaluar el resultado.
export { rotateLeft };
0respuestas