Solución
solution.tsTypeScript
import math
def is_armstrong(num: int) -> bool:
p = num and -~int(math.log10(num))
s, t = 0, num
while t:
s += (t % 10) ** p
t //= 10
return s == num0respuestas
import math
def is_armstrong(num: int) -> bool:
p = num and -~int(math.log10(num))
s, t = 0, num
while t:
s += (t % 10) ** p
t //= 10
return s == numAú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.