Question: Will rate if done in python. Description A palindrome is a string that reads the same forward or backwards. Putting it another way, ls its

Will rate if done in python. Description A palindrome is a stringWill rate if done in python.

Description A palindrome is a string that reads the same forward or backwards. Putting it another way, ls its reversal. So ogopogo an Your task is simple. Find the length of the longest odd-length palindrome that is a substring of a given string. We do not care about palindromes of even length today. Input Input consists of a single line with a single string. This string will contain only lowercase letters and will have length between 1 and 1000. Output Output a single integer k on a single line. This should be the length of the longest odd-length palindrome that appears as a substring of the input string. Sample Input 1 banana Sample Output 1 Explanation for Sample 1 The string anana is a palindrome with length 5, and there are no longer odd-length palin- dromes

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!