Problem
Ask
Submissions

Problem: Valid Palindrome II

Medium
30 min
Explore how to efficiently check if a string can be converted into a palindrome by removing at most one character. Understand the two-pointer technique, its application in linear data structures, and implement an optimal O(n) time and O(1) space solution.

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:

  • 11 \leq string.length \leq 10510^5

  • The string only consists of English letters.

Problem
Ask
Submissions

Problem: Valid Palindrome II

Medium
30 min
Explore how to efficiently check if a string can be converted into a palindrome by removing at most one character. Understand the two-pointer technique, its application in linear data structures, and implement an optimal O(n) time and O(1) space solution.

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:

  • 11 \leq string.length \leq 10510^5

  • The string only consists of English letters.