9. Palindrome Number
題目原文
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Example 1:
Example 2:
Example 3:
Follow up:
Could you solve it without converting the integer to a string?
解題思路
每次先計算% ,取得最低位,每次迭代*10變成reverse的最高位。
最後比較兩數是否相等。
負數必為False。
程式解答
Last updated
Was this helpful?