← 返回 meta 的题目列表Valid Palindrome II
类型:online_judge
Problem: Valid Palindrome II
Given a string s, determine whether it can become a palindrome after deleting at most one character.
If s is already a palindrome, the answer should also be true.
Input Format
The input contains one line: the string s.
Output Format
Print true if s can become a palindrome after deleting at most one character.
Otherwise, print false.
Constraints
1 <= s.length <= 100000
s contains only lowercase English letters.
Example 1
Input:
aba
Output:
true
Example 2
Input:
abca
Output:
true
Explanation: You can delete either b or c.
Example 3
Input:
abc
Output:
false
Example
Input
aba
Output
true