25. Palindrome Number

Easy · String

Given an integer, determine whether it is a palindrome. An integer is a palindrome if it reads the same forwards and backwards. Negative numbers are not palindromes.

Examples

Example 1
Input: 121
Output: true
Explanation: 121 reads the same forwards and backwards, so it is a palindrome.
Example 2
Input: -121
Output: false
Explanation: Negative numbers are not considered palindromes.

Constraints