Easy · Math

Is palindromic number

Given an integer n, return true if its decimal digits read the same forwards and backwards (for example 121 or 1221), and false otherwise; negative numbers are never palindromes.

Examples

Example 1

n = 121

Output: true

Example 2

n = 1234

Output: false

Rebuild it in the studio

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Math problems