Skip to content

Commit 717ce19

Browse files
committed
upload solution to 125. Valid Palindrome
1 parent eba5782 commit 717ce19

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

125.valid-palindrome.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# EASY
2+
3+
# first submission
4+
# runtime: 42 ms O(n)
5+
# memory: 17.1 MB
6+
class Solution:
7+
def isPalindrome(self, s: str) -> bool:
8+
s = ''.join(filter(str.isalnum, s.lower()))
9+
10+
return s == s[::-1]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy