Solución
solution.tsTypeScript
export function maxDigit(n: number): number {
let max = 0;
while(n>9){
if(n%10 > max) max = n%10;
n = Math.floor(n/10);
}
if(n > max) max = n;
return max;
}0respuestas
export function maxDigit(n: number): number {
let max = 0;
while(n>9){
if(n%10 > max) max = n%10;
n = Math.floor(n/10);
}
if(n > max) max = n;
return max;
}Aún no hay respuestas
¡Sé el primero en responder!
Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.