Skip to content
We areTOP 1%

Palindrome Number

EasyLeetCodeMath & Implementation
Solve on LeetCode(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Approach hintTry it first, then reveal

Negative numbers and numbers ending in 0, other than 0 itself, are not palindromes. Otherwise reverse only the second half of the digits and compare it with the first half, which also avoids overflow.

More in Math & Implementation

Math & Implementation questions
#ProblemPlatformDifficultyOpen1st1st Visit2nd2nd VisitRevRevise
1WatermelonCodeforcesEasy 800Solve Watermelon on Codeforces (opens in a new tab)
2Fizz BuzzLeetCodeEasy Solve Fizz Buzz on LeetCode (opens in a new tab)
3ElephantCodeforcesEasy 800Solve Elephant on Codeforces (opens in a new tab)
4Soldier and BananasCodeforcesEasy 800Solve Soldier and Bananas on Codeforces (opens in a new tab)
5Divisibility ProblemCodeforcesEasy 800Solve Divisibility Problem on Codeforces (opens in a new tab)
6Palindrome NumberLeetCodeEasy Solve Palindrome Number on LeetCode (opens in a new tab)
7Plus OneLeetCodeEasy Solve Plus One on LeetCode (opens in a new tab)
8Happy NumberLeetCodeEasy Solve Happy Number on LeetCode (opens in a new tab)
9Multiply by 2, divide by 6CodeforcesEasy 900Solve Multiply by 2, divide by 6 on Codeforces (opens in a new tab)
10Even OddsCodeforcesEasy 900Solve Even Odds on Codeforces (opens in a new tab)
11Odd DivisorCodeforcesEasy 900Solve Odd Divisor on Codeforces (opens in a new tab)
12Almost PrimeCodeforcesEasy 900Solve Almost Prime on Codeforces (opens in a new tab)
13Theatre SquareCodeforcesEasy 1000Solve Theatre Square on Codeforces (opens in a new tab)
14K-th Not Divisible by nCodeforcesEasy 1200Solve K-th Not Divisible by n on Codeforces (opens in a new tab)
15Count PrimesLeetCodeMedium Solve Count Primes on LeetCode (opens in a new tab)
16Next PermutationLeetCodeMedium Solve Next Permutation on LeetCode (opens in a new tab)

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account