Your question is Palindrome Check With Complexity. 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.
Decision Point's QA validation utilities need to identify whether an input string is a palindrome. Implement a function that compares the string case-insensitively while ignoring spaces, punctuation, and other non-alphanumeric characters.
Use a two-pointer approach so the function runs in linear time and uses constant auxiliary space. An empty string after normalization is considered a palindrome.
s, a string containing letters, digits, whitespace, and punctuation.True if the normalized string reads identically from left to right and right to left. Otherwise, return False.def is_palindrome(s):