Valid Palindrome Problem

Valid Palindrome Problem — ExecCode Easy DSA Practice

Solve the Valid Palindrome problem on ExecCode. Free online easy DSA practice in Two Pointers. Write and run code in Java, C++, Python — no signup required to run.

Problem description

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.

Examples

Input s = "level"; Output true. Input s = "hello"; Output false. Input s = "A man, a plan, a canal: Panama"; Output true

Constraints

1 ≤ s.length ≤ 2 × 10⁵ s consists only of printable ASCII characters

Practice Valid Palindrome free on ExecCode. Browse DSA problems, topic map, and placement guides.