Solución
solution.tsTypeScript
function rotateString(text: string, k: number): string {
if(text.length === 0, k === 0) return text
let rotation = k % text.length
return text.slice(rotation) + text.slice(0, rotation);
}
// No modificar: necesario para evaluar el resultado.
export { rotateString };0respuestas