← 返回 meta 的题目列表Valid Palindrome After At Most One Deletion
类型:online_judge
Given a string s consisting of lowercase letters, determine if it can become a palindrome by deleting at most one character.
Return true/false.
Constraints:
1 <= len(s) <= 1e5
Examples:
Input: "aba" Output: true
Input: "abca" Output: true (delete 'c')
Input: "abc" Output: false
Requirement: O(n) time.
Example
Input
aba
Output
true