At Stripe, you need to validate whether a user-entered string reads the same forward and backward when punctuation, spaces, and other non-alphanumeric characters are ignored. Write an algorithm that returns whether the cleaned string is a palindrome.
Implement a function that takes a single string s and returns a boolean:
s — a string containing letters, digits, spaces, and special charactersTrue if the string is a palindrome after removing all non-alphanumeric characters and ignoring letter case; otherwise Falsedef is_palindrome(s):