reverse integer 思路 代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Given a 32-bit signed integer, reverse digits of an integer.

Example 1:

Input: 123
Output: 321
Example 2:

Input: -123
Output: -321
Example 3:

Input: 120
Output: 21

思路

异常情况

需要考虑到的特殊情况