Valid Palindrome

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Write isPalindrome(text): return true if text reads the same forwards and backwards once you ignore case and keep only the letters a–z and digits 0–9. "A man, a plan, a canal: Panama!" is a palindrome; "race a car" isn't. Text with no letters or digits at all counts as one.

Your code must pass

  • Recognises simple palindromes
  • Ignores case, spaces and punctuation
  • Rejects text that isn't a palindrome
  • Treats empty text and punctuation only as palindromes