Quant Memo
Coding/●●●●●

Is this a palindrome, ignoring punctuation and case?

Given a phrase, decide whether it is a palindrome when you consider only its letters and digits and treat uppercase and lowercase as equal.

"A man, a plan, a canal: Panama"  -> True
"race a car"                      -> False
""                               -> True

Return a boolean in O(n)O(n) time and O(1)O(1) extra space. Do not build a cleaned copy of the string; scan in place.

Show a hint

Put one finger at each end and walk them toward each other. What do you do when a finger lands on a comma or a space?

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions