update project structure
This commit is contained in:
11
leetcode_py/9.py
Normal file
11
leetcode_py/9.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Given an integer, return true if x is a palindrome
|
||||
|
||||
|
||||
class Solution:
|
||||
def isPalindrome(self, x: int) -> bool:
|
||||
if x < 0:
|
||||
return False
|
||||
str_x = str(x)
|
||||
inv_str_x = str_x[::-1]
|
||||
int_inv_str_x = int(inv_str_x)
|
||||
return x == int_inv_str_x
|
||||
Reference in New Issue
Block a user