Valid Palindrome II
EasyP2Coding
Return true if s is a palindrome or can become one by deleting at most one character, and false otherwise.
Example 1
- Input
- s = "aba"
- Output
- true
Example 2
- Input
- s = "abca"
- Output
- true
Example 3
- Input
- s = "abc"
- Output
- false
Constraints
- 1 <= s.length <= 10^5
- s consists of lowercase letters.
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 13. ⌘Enter runs, ⌘⇧Enter submits.