In this tutorial, I am going to discuss a variation of palindrome questions valid palindrome II. In this problem, we can remove a character from a string to make it a palindrome.
Given a non-empty string, We may delete at most one character from a string. We have to write a code which checks whether we can make this string palindrome or not.
For example –
Example 1:
Input : “aba”
Output: true
This string is already palindrome. So we return true.
Example 2:
Input : “abca”
Output: true
This string is not a palindrome. But, if we delete either a character b or c from this string then the new string is a palindrome.