Trim Ending Zeros
Trailing zeros can make a number harder to read when they do not add meaning, such as in a short code or batch number. Write a function no_boring_zeros that takes a non-negative integer n and removes all zeros from the end. If the input is 0, return 0.
Примеры
Ввод
1450Вывод
145Ввод
960000Вывод
96Ввод
1050Вывод
105Нужно реализовать
def no_boring_zeros(n: int) -> int:
Теги
math
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
1450Expected
1452
Input
960000Expected
963
Input
1050Expected
1054
Input
-1050Expected
-1055
Input
0Expected
06
Input
-1Expected
-1Focus radio
Paused · SomaFM · Fluid