Notes

Personal notes on various topics

View on GitHub

Valid Palindrome

Problem Statement

A phrase is considered a palindrome if, after converting all uppercase letters to lowercase and removing all non-alphanumeric characters, it reads the same forwards and backwards. Alphanumeric characters include both letters and numbers.

Given a string s, determine whether it is a palindrome. Return true if it is a palindrome, and false otherwise.

Examples

Example 1:

Example 2:

Example 3:

Constraints

Code Template

class Solution:
    def isPalindrome(self, s: str) -> bool:
        # Your code here
        pass

Solutions

Back to Problem List Back to Categories