Leetcode7-Reverse Integer(Python3)

7. Reverse Integer

Reverse digits of an integer.

Example1:x = 123, return 321

Example2:x = -123, return -321

click to show spoilers.

Note:

The input is assumed to be a 32-bit signed integer. Your function shouldreturn 0 when the reversed integer overflows.


My Solution



Leetcode7-Reverse Integer(Python3)_第1张图片


参考答案Python2(转):


Leetcode7-Reverse Integer(Python3)_第2张图片

你可能感兴趣的:(Leetcode7-Reverse Integer(Python3))