← 返回 meta 的题目列表Valid Palindrome with One Removal
类型:online_judge
Given a string s, you are allowed to remove at most one character. Determine whether it can be a palindrome after deleting at most one character. Consider only alphanumeric characters and ignore case sensitivity. The maximum length of s is 10^5.
Input
string s
Output
bool whether the result can be a palindrome after deleting at most one character.
Example
# Example 1:
Input: s = "abca"
Output: True
Explanation: You could delete the character 'c'.
# Example 2:
Input: s = "abc"
Output: False
Explanation: There's no way to delete one character to make it a palindrome.
Example
Input
abca