Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 737 Bytes

0125-valid-palindrome.adoc

File metadata and controls

34 lines (22 loc) · 737 Bytes

125. Valid Palindrome

基本思路就是从两边想中间挤压。记得前不久有一道题使用了相似的处理手段,容我有时间找找看!

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

Note: For the purpose of this problem, we define empty string as valid palindrome.

Example 1:

Input: "A man, a plan, a canal: Panama"
Output: true

Example 2:

Input: "race a car"
Output: false
link:{sourcedir}/_0125_ValidPalindrome.java[role=include]