
How to check if a string is a Valid Palindrome: O(n) two pointer solution explained
Problem Overview We are given a string s. The string consists of all printable ASCII characters. Goal is to check if the string is a palindrome — but first we need to remove non-alphanumeric characters, then check. A palindrome is a word or sentence if that reads the same backwards as forewords LeetCode - Valid Palindrome Example Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome. ...