9. Palindrome Number

EasyMath

Given an integer x, return true if x is a palindrome, and false otherwise. An integer is a palindrome when it reads the same forward and backward. For example, 121 is a palindrome while 123 is not.

Examples

Input: 1221

Output: true

Explanation: Reversing the back half (12) equals the front half (12).

Constraints

  • -2^31 <= x <= 2^31 - 1
Loading...

Run checks all cases above. Submit evaluates all test cases.