A lot of times using Python feels like cheating when doing leetcode...
Slicing. Lambda. Cool builtin functions.
def isPalindrome(self, s): new_s = filter(lambda x: x.isalnum(), s).lower() return new_s == new_s[::-1]
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.