Skip to content

Grind 75 - Valid Palindrome

Posted on:August 4, 2023 at 12:34 AM at 1 min read

Solution for Valid Palindrome problem which is a part of Grind 75 list.

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

Comments