Same Forward and Back
A palindrome is a value that reads the same from left to right and from right to left. Given an integer x, return True if it is a palindrome. Negative numbers do not count as palindromes because the minus sign appears only on the left.
Примеры
Ввод
121Вывод
TrueВвод
-121Вывод
FalseВвод
10Вывод
FalseНужно реализовать
def is_palindrome_number(x: int) -> bool:
Теги
math
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj sięVisible tests
1
Input
121Expected
True2
Input
-121Expected
False3
Input
10Expected
False4
Input
0Expected
True5
Input
12321Expected
True6
Input
7Expected
TrueFocus radio
Paused · SomaFM · Fluid