Valid Palindrome

Easy · Arrays & Strings · about 10 minutes

Asked at Meta, Bloomberg, Apple, Amazon, Microsoft, Google.

Decide whether the text s is a palindrome once you ignore case and throw away everything that is not a letter or a digit, i.e. whether the cleaned-up characters match when read from either end.

Related guides