Question: You'll be given an input String that is a sequence of characters including lower-case letters and blanks. You re to output the longest string, guaranteed

You'll be given an input String that is a sequence of characters including lower-case letters and blanks. You re to output the longest string, guaranteed to be longer than 1 character, that is a palindrome without the letter a in it. For example, one famous palindrome is "able was i ere i saw elba", supposedly the lament of Napoleon. The whole sentence is a palindrome, but the longest one without the letter a is "s i ere i s".

import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*;

public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

// you'll be given a string as input here.

// you'll need to output as a string the longest palindrome lacking the letter a

// you can declare your own variables and functions if you want them.

String theInputString = bufferedReader.readLine();

// Write your code here

bufferedReader.close(); } }

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!