美文网首页
LeetCode7 - Reverse Integer [ea

LeetCode7 - Reverse Integer [ea

作者: thousand_ | 来源:发表于2018-05-15 21:51 被阅读0次

题目链接🔗:

https://leetcode-cn.com/problems/reverse-integer/description/

题目原文

Reverse digits of an integer. 

Example1: x = 123, return 321 

Example2: x = -123, return -321

思路:

利用Python的字符串反转操作来实现对整数的反转,反转后的字符串要重新转换为整数。同上面一样,要注意正负和溢出情况。

相关文章

网友评论

      本文标题:LeetCode7 - Reverse Integer [ea

      本文链接:https://www.haomeiwen.com/subject/iazydftx.html