Back to problems

Check Whether an Integer Reads the Same Backward

Algorithm · Google · Medium

Given a signed integer x, determine whether its base-10 digits form a palindrome. That is, reading the digits from left to right should give the same sequence as reading them from right to left. Return true when this symmetry holds and false otherwise. A negative value must return false, since the leading minus sign has no matching character on the right. You may assume x can be stored in a signed 32-bit integer. Prefer a solution that does not convert x into a string.…

Checking your access…