Approach

Simply convert the input to lower if it’s an alphanumeric char then just return if it’s equal to it’s reversed string

Code

class Solution:
    def isPalindrome(self, s: str) -> bool:
        s = [c.lower() for c in s if c.isalnum()]
        return s == s[::-1]