Your question is Python Palindrome Function. 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.
SAS Viya validation tools may receive identifiers and messages with inconsistent capitalization or punctuation. Write a function that determines whether a string is a palindrome after converting letters to lowercase and ignoring all non-alphanumeric characters.
Implement is_palindrome(s), where s is a Python string. Return True if the normalized string reads the same from left to right and right to left. Return False otherwise. A normalized string contains only lowercase letters and digits.
Use a two-pointer approach that compares characters from both ends without creating a reversed copy of the input.
def is_palindrome(s):