题目
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. **Example 1:** **Input:** 121 **Output:** true **Example 2:** **Input:** -121 **Output:** false **Explanation:** From left to right, it reads -121\. From right to left, it becomes 121-. Therefore it is not a palindrome. **Example 3:** **Input:** 10 **Output:** false **Explanation:** Reads 01 from right to left. Therefore it is not a palindrome. **Follow up:** Coud you solve it without converting the integer to a string?
解法
一
思路
求出回文数,进行比较
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于