Skip to content

Latest commit

 

History

History

valid-palindrome

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

< Previous                  Next >

Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

 

Example 1:

Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: "amanaplanacanalpanama" is a palindrome.

Example 2:

Input: s = "race a car"
Output: false
Explanation: "raceacar" is not a palindrome.

 

Constraints:

  • 1 <= s.length <= 2 * 105
  • s consists only of printable ASCII characters.

Related Topics

[Two Pointers] [String]

Similar Questions

  1. Palindrome Linked List (Easy)
  2. Valid Palindrome II (Easy)