Menu
Question Index
...


Write a program to find longest substring which is a palindrome.

Input (String) Output (String)
MERITCAMPUSSUPMACMERIT CAMPUSSUPMAC
SCAJAVAAVAJAVS AJAVAAVAJA
HARDDRAARDD DDRAARDD
PRINTTNIPRI INTTNI

class FindLongestPalindromicSubstring

{    public static void main(String s[])
    {
        String input = "MERITCAMPUSSUPMACMERIT";
        System.out.println("Longest Palindromic Substring present in " + input + " is " + getLongestPalindromicSubstring(input));

    }


public static String getLongestPalindromicSubstring(String input) {
//Write code here to get longest palindromic substring
}

//If required, write any additional methods here
}

Doubts

Problems

Topic: Java String substring() method - substring In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App