Your question is Palindrome Check. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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):