Facebook Pixel
Valid Palindrome
Easy

Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

Example:

Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: After removing non-alphanumeric characters, it becomes "amanaplanacanalpanama", which is a palindrome.

Input: s = "race a car"
Output: false
Explanation: After removing non-alphanumeric characters, it becomes "raceacar", which is not a palindrome.
Test Cases

Test Cases

Input
Do geese see God
Expected Output
true
Step 1
Step 2
Step 3
Step 1: Identify the Pattern
Valid Palindrome
Easy

Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

Example:

Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: After removing non-alphanumeric characters, it becomes "amanaplanacanalpanama", which is a palindrome.

Input: s = "race a car"
Output: false
Explanation: After removing non-alphanumeric characters, it becomes "raceacar", which is not a palindrome.
Test Cases

Test Cases

Input
Do geese see God
Expected Output
true
Step 1
Step 2
Step 3
Step 1: Identify the Pattern