Skip to content

Latest commit

 

History

History

Problem3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Valid Palindrome

Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.

Note: The string will only contain lowercase characters a-z. The maximum length of the string is 50000.

Example 1:

Input: "aba"
Output: true
Explanation: It is a valid palindrome.

Example 2:

Input: "abca"
Output: true
Explanation: You could delete the character 'c'.

Example 3:

Input: "abcdefdba"
Output: false
Explanation: It is not possible to become palindrome even if we remove one character from the string.

Q/A:

  • Do we consider a palindrome as almost a palindrome?
    • Yes, return true if the string is already a palindrome.