Reverse Number Digits

Sometimes you need to split a number into digits and build it back in a different order, which is good practice for working with numbers and strings. Write a function reverse_integer that reverses the digits of the non-negative integer n. If the reversed number starts with zeros, they disappear automatically: for example, 1200 becomes 21. For 0, return 0.

Примеры

Ввод
123
Вывод
321
Ввод
1200
Вывод
21
Ввод
0
Вывод
0

Нужно реализовать

def reverse_integer(n: int) -> int:

Теги

math
PostgreSQLv16

Hier erscheint das Ergebnis der Codeausführung

Visible tests
1
Input
123
Expected321
2
Input
1200
Expected21
3
Input
0
Expected0
4
Input
5
Expected5
5
Input
100000
Expected1
6
Input
987654321
Expected123456789
Focus radio
Paused · SomaFM · Fluid