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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started