Clean Palindrome Checker

String Manipulation Palindrome Easy Holiday

Clean Palindrome Checker

Write a function that determines whether a given string is a palindrome. The function should ignore all non-alphanumeric characters and treat uppercase and lowercase letters as equal.

For example:

  • Input: "Santa at NASA"
    • After cleaning (ignoring spaces and punctuation, and converting to lowercase): "santaatnasa"
    • Since "santaatnasa" is the same forwards and backwards, the function should return true.
  • Input: "Hello, World!"
    • Cleaned: "helloworld"
    • Since "helloworld" is not a palindrome, the function should return false.

Function Signature:

isCleanPalindrome(input: string) -> boolean

Make sure to test your solution with various inputs, including edge cases like an empty string or a string with only non-alphanumeric characters.