Problem
Return true if the integer x reads the same forwards and backwards in decimal. Try to do it without converting the number to a string.
Example 1
- Input
- x = 121
- Output
- true
Example 2
- Input
- x = -121
- Output
- false
- Why
- reads 121- backwards
Example 3
- Input
- x = 10
- Output
- false
- Why
- reads 01 backwards
Constraints
-2^31 <= x <= 2^31 - 1