Samsung·Machine Learning Engineer·Technical Phone Screen
- Given a string, return true if it reads the same forwards and backwards after stripping non-alphanumeric characters and ignoring case. Your solution must run in O(n) time and use O(1) extra space.
- Modify your palindrome solution so it returns true if the string can become a palindrome by deleting at most one character.
- How would you extend this solution to handle full Unicode, including combining marks and non-ASCII letters?
- Write test cases for your palindrome solution and analyze the time and space complexity of each variant you implemented.
“Two pointers from both ends, skip non-alphanumeric chars, compare lowercased.”