Valid Palindrome
Question
Example:
Hint
Answer
solution:this is done myself.
class Solution(object):
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
a = []
for i in s:
[a.append(b) for b in re.findall("[A-Za-z0-9]+",i) if b]
for i in xrange((len(a))/2):
if a[i].lower() == a[len(a)-1-i].lower():
pass
else:
return False
return TrueKnowledge:
Last updated