Valid Palindrome II

Try to solve the Valid Palindrome II problem.

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.

Examples