Coding basics · 13 of 20
Reverse a number
Return the digits of a non-negative integer n in reverse order, as a number (so 1200 becomes 21).
Examples
Input n = 1234
Output 4321
Input n = 1200
Output 21
Leading zeros vanish in a number.
Coding basics · 13 of 20
Return the digits of a non-negative integer n in reverse order, as a number (so 1200 becomes 21).
Input n = 1234
Output 4321
Input n = 1200
Output 21
Leading zeros vanish in a number.