Valid Palindrome II

Easy

Topics
StringTwo PointersGreedy

Given a string s, return true if it can be a palindrome after deleting at most one character.

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 English letters.
Run ⌘' · Submit ⌘⏎