Problem
Ask
Submissions

Problem: Valid Palindrome II

Medium
30 min
Explore how to verify if a given string can be transformed into a palindrome by deleting one character. Learn to apply the two pointers technique to solve this problem efficiently in linear time and constant space. This lesson helps you understand problem constraints and devise an optimal solution on your own.

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 verify if a given string can be transformed into a palindrome by deleting one character. Learn to apply the two pointers technique to solve this problem efficiently in linear time and constant space. This lesson helps you understand problem constraints and devise an optimal solution on your own.

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.