/9. Palindrome Number

9. Palindrome Number

Easy
Probability60.3% acceptance

Given an integer input_value, return True if input_value is a palindrome (reads the same forwards and backwards), otherwise return False.

Example 1

Input: input_value = 1331

Output: True

Explanation: 1331 reads the same forwards and backwards.

Example 2

Input: input_value = -101

Output: False

Explanation: Negative numbers are not palindromes.

Example 3

Input: input_value = 1001

Output: True

Explanation: 1001 reads the same forwards and backwards.

Example 4

Input: input_value = 123

Output: False

Explanation: 123 does not read the same forwards and backwards.

Constraints

  • -231 <= input_value <= 231 - 1
Python (current runtime)

Case 1

Input: input_value = 444

Expected: True

Case 2

Input: input_value = 0

Expected: True

Case 3

Input: input_value = -202

Expected: False

Case 4

Input: input_value = 98789

Expected: True

Case 5

Input: input_value = 12021

Expected: True