Palindrome Number
Given an integer x, return true if x is a palindrome, and false otherwise.

30:00

Palindrome Number
easy
Topics
Companies

Given an integer x, return true if x is a palindrome, and false otherwise.

Example 1:
Input: 121
Output: true
Constraints:
  • 231x2311-2^{31} \leq x \leq 2^{31} - 1

Input
arr =121

Check palindrome

Original: x = 121

1

2

1

Reversed half: 0

0

Checking 121...

x: 121
reversed: 0
Variables
VariableValue
x121
DepthFunction Call
Stack empty
0/3