Skip to content

Latest commit

 

History

History

reverse-a-number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Given a number, write a function to output its reverse digits. (e.g. given 123 the answer is 321)

Numbers should preserve their sign; i.e. a negative number should still be negative when reversed.

Examples

 123 ->  321
-456 -> -654
1000 ->    1