Your question is Palindrome Without Loops. 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.
Dayforce may validate employee-facing identifiers that contain spaces, punctuation, and mixed casing. Implement a function that determines whether a text value is a palindrome without using any for loops, while loops, list comprehensions, or generator expressions.
Ignore every character that is not alphanumeric, and compare letters without regard to case. Use recursion to move two pointers inward from the beginning and end of the string.
Implement is_palindrome(text), where text is a string. Return True if the normalized text reads identically from left to right and right to left. Return False otherwise. An empty string or a string containing no alphanumeric characters is a palindrome.
isalnum() returns Falsedef is_palindrome(text):