Palindrome Number
Return true if x reads the same forward and backward.
Examples
Input: 121
Output: true
Input: -121
Output: false
Hints
Reverse the second half of the number and compare it with the first half to determine if it's a palindrome.
Avoid converting the entire number to a string by using mathematical operations to extract and compare digits from both ends.
Handle edge cases like single-digit numbers and numbers ending with zero (except zero itself) efficiently without unnecessary computations.
Related Problems
Palindrome Number
Return true if x reads the same forward and backward.