In an Allstate mobile app text-processing utility, implement a function that determines whether a string is a palindrome when special characters are ignored. Comparison should be case-insensitive, and only letters and digits should be considered.
strue if the cleaned string reads the same forward and backwardfalse otherwiseA character should be included only if it is alphanumeric (a-z, A-Z, 0-9). Spaces, punctuation, and symbols must be ignored.
Example 1
s = "A man, a plan, a canal: Panama"trueamanaplanacanalpanama, which is a palindrome.Example 2
s = "race a car"falseraceacar, which is not the same in reverse.0 <= len(s) <= 10^5s may contain letters, digits, spaces, punctuation, and symbols