Question

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.

Given a string s, return true if it is a palindrome, or false otherwise.

This is antwo_pointers question.

Idea
Normalize the given string (only alpha numeric chars, remove whitespace, all lowercase), then start two points at the beginning and end of the string, as you move the pointers closer to each other, check for equality.

Solution