JPMorgan Chase QA systems may receive reference strings containing inconsistent capitalization, spaces, or punctuation. Given a reference string, determine whether it is a palindrome after converting letters to lowercase and ignoring every non-alphanumeric character.
Use an efficient two-pointer algorithm that compares valid characters from the beginning and end without creating a second normalized string.
Implement is_palindrome(text), where text is a string containing ASCII letters, digits, spaces, and punctuation. Return True if the normalized string reads identically forward and backward. Return False otherwise. An empty string, or a string containing no alphanumeric characters, is considered a palindrome.
def is_palindrome(text):