Minimum Deletions in a String to make it a Palindrome

Statement

You are given a string s. The task is to count the minimum deletions from s such that the resultant string is a palindrome.

Let’s take an example string, “radear”. We can remove the character “e” from this string and we will be left with “radar”, which is a valid palindrome. So, we need minimum of one deletion to make this string a valid palindrome.

Constraints:

  • s contains all lowercase characters.
  • 11 \leq s.length 900\leq 900

Examples

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.