[LeetCode]9. 回文数

数据库82

确定整数是否为回文。回文的数量意味着正向顺序(从左到右)和反向顺序(从右到左)是相同的整数。

[En]

Determines whether an integer is a palindrome. The number of palindromes means that the positive order (from left to right) and the reverse order (from right to left) are the same integers.

示例 1:

输入: 121
输出: true
示例 2:

输入: -121
输出: false
解释: 从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。
示例 3:

输入: 10
输出: false
解释: 从右向左读, 为 01 。因此它不是一个回文数。
进阶:

你能不将整数转为字符串来解决这个问题吗?

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长