Dell PowerStore asset labels are checked for mirrored identifiers during a validation workflow. Given a string label, determine whether it is a palindrome after ignoring letter case and all non-alphanumeric characters.
A palindrome reads the same from left to right and right to left after normalization. For example, "A man, a plan, a canal: Panama" is a palindrome because its normalized form is "amanaplanacanalpanama".
Implement is_palindrome(label).
label, a string containing letters, digits, spaces, and punctuation.true if the alphanumeric characters in label, compared case-insensitively, form a palindrome. Otherwise return false.Use a two-pointer scan. Do not build a separate normalized string.
def is_palindrome(label):