Tap here to switch tabs
Problem
Submissions

Problem: Valid Palindrome II

Valid Palindrome II asks whether a given string can become a palindrome after removing at most one character, and requires returning whether such a valid palindrome exists.

Statement

Write a function that takes a string as input and checks whether it can be a valid palindrome by removing at most one character from it.

Constraints:

  • 1≤1 \leq string.length ≤\leq 10510^5

  • The string only consists of English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Valid Palindrome II

Valid Palindrome II asks whether a given string can become a palindrome after removing at most one character, and requires returning whether such a valid palindrome exists.

Statement

Write a function that takes a string as input and checks whether it can be a valid palindrome by removing at most one character from it.

Constraints:

  • 1≤1 \leq string.length ≤\leq 10510^5

  • The string only consists of English letters.