Skip to content

Commit 02f8451

Browse files
committed
Time: 46 ms (64.65%) | Memory: 17.2 MB (80.26%) - LeetSync
1 parent c508360 commit 02f8451

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Solution:
2+
def isPalindrome(self, s: str) -> bool:
3+
org_str = ''.join([x for x in s.lower() if (ord(x) >= 97 and ord(x) <=122) or x.isnumeric()])
4+
return org_str == org_str[::-1]

0 commit comments

Comments
 (0)