let's solve more as a compensation
This commit is contained in:
13
easy/palindrome-number.py
Normal file
13
easy/palindrome-number.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# yigid balaban <fyb@fybx.dev>
|
||||
# neetcode 2024
|
||||
# easy / palindrome number
|
||||
|
||||
def solution(x: int) -> bool:
|
||||
return str(x) == str(x)[::-1]
|
||||
|
||||
|
||||
print(solution(121) == True)
|
||||
print(solution(0) == True)
|
||||
print(solution(-121) == False)
|
||||
print(solution(10) == False)
|
||||
Reference in New Issue
Block a user