Valid Palindrome
Easy
Question
A phrase is a palindrome if it reads the same forward and backward after ignoring all non-alphanumeric characters like punctuation, symbols, capitalization, and spaces.
Write a function which returns true if the given string is a palindrome, and false if it’s not.
Input: input = "H"an ah!"
Output: True
Input: input = "Hugo"
Output: False
Input: input = "step on no pets!"
Output: True
Input: input = "step on no pets!"
Output: False
Clarify the problem
What are some questions you'd ask an interviewer?
Understand the problem
Based on the above criteria, which of these is NOT a valid palindrome?
Live on time emit no evil
do geese see god
racec@r
r@cec@r
All test cases pass! 🎉
Time limit exceeded
InputExpected OutputActual Output
Standard OutputScroll down...
Login or signup to save your code.
Uh oh... looks like you don't yet have access.
Not sure what this unlocks? Check out a free pattern section.