Question: In Java or C# Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example

In Java or C#

Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.

Example 1: Input: "aba" Output: True

Example 2: Input: "abca" Output: True Explanation: You could delete the character 'c'.

Example 3: Input: "abcd" Output: False

Input Format

A string with lowercase 'a' to 'z'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!