Palindrome number

Beginner Problems Basic Maths Easy
  • Palindrome checking, as in this problem, is often used in error detection within computer systems
  • It's used specifically in the realm of ECC (Error Checking and Correction) memory, commonly seen in crucial systems such as servers
  • Here, bits are encoded with a simple algorithm which checks if a string of binary data reads the same backwards as forwards to prevent potential crashes from memory faults
  • Additionally, palindrome checking can be applied in string processing within Natural Language Processing (NLP) applications for linguistic pattern detection

You are given an integer n. You need to check whether the number is a palindrome number or not. Return true if it's a palindrome number, otherwise return false.


A palindrome number is a number which reads the same both left to right and right to left.

Examples:

Input: n = 121

Output: true

Explanation: When read from left to right : 121.

When read from right to left : 121.

Input: n = 123

Output: false

Explanation: When read from left to right : 123.

When read from right to left : 321.

Input: 101

Constraints

  • 0 <= n <= 5000
  • n will contain no leading zeroes except when it is 0 itself.

Company Tags

TCS Cognizant Accenture Infosys Capgemini Wipro IBM HCL Tech Mahindra MindTree