原题:
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: trueExample 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.
回文int判断的题,一开始用递归算速度不行,结果如下:
Success
Runtime: 36 ms, faster than 82.87% of C++ online submissions for Palindrome Number.
Memory Usage: 8 MB, less than 99.78% of C++ online submissions for Palindrome Number