Question: Coding Question Problem Statement Given a string S, find the longest palindromic substring in S. Incase there are 2 or more substrings of same length,

 Coding Question Problem Statement Given a string S, find the longest

palindromic substring in S. Incase there are 2 or more substrings of

same length, return the substring which occurs first (with the least starting

Coding Question Problem Statement Given a string S, find the longest palindromic substring in S. Incase there are 2 or more substrings of same length, return the substring which occurs first (with the least starting index) Input: The testcase consists of a String S. Output: Print the longest palindrome of the string given in test case. NOTE: Spaces are not considered. In case no palindromic substring exists. print the 1 st character, since single characters are palindromic in nature Constraints: 1str100 1str100 Example 1: Input: abnamalayalamano Output: namalayalaman Example 2: Input: abmadambc Output: bmadamb The above mentioned example is a sample in the backend. Make sure you click the Previous in the backend. Make sure you click the SUBMIT button to save and submit your answer. 1 ATP 1: start writing your answer from line 8 2 3 import sys \#this lines imports sys library 4 input_from_question=input() \#Gets the Input 5 6 - def solution(input_from_question): 7 \#\# WRITE YOUR ANSWER HERE \#\# 8 \#TIP 2: use input() again to get input in different lines \#TIP 3: use input_from_question.split(' ') to get different values return print(solution(input_from_question)) \#Printing the output

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!