← 返回 apple 的题目列表Validate Palindrome String (Alphanumeric, Case-Insensitive)
类型:online_judge
Problem: Validate Palindrome (Alphanumeric Only, Case-Insensitive)
Given a string s, determine whether it is a palindrome.
A palindrome reads the same forward and backward.
Rules
Consider only letters and digits (i.e., a-z, A-Z, 0-9).
Ignore case (e.g., A equals a).
Provide the time and space complexity of your solution.
I/O
Input: one line string s
Output: print true if palindrome, otherwise false
Constraints
0 <= len(s) <= 2 * 10^5
Examples
Input: A man, a plan, a canal: Panama Output: true
Input: race a car Output: false
Example
Input
A man, a plan, a canal: Panama
Output
true