Mr.Watson And Longest Palindrome

3

1 votes
Hard, Code Golf
Problem

Contributor : Sneha

Mr.Watson being idle all this while,thought of challenging himself and utilize his brain in order to calculate the length of longest Palindromic substring of a given string.

A palindrome is a string which is the same when read forwards and backwards. For example "madam" is a palindrome, but "Madam" is not. A substring is a contiguous set of characters in a larger string.

He wants to write a program or devise a method which takes a string or character array as input and outputs the length of the longest sub-string of that string which is a palindrome.Can you people help him out to devise such method and hence fulfill the task?

Input: Any string or character array

Output: integer value(length) of longest palindromic substring.

SCORING

This is a codegolf problem. Score = maxScore* (500 - S)/500

S = Number of characters in source code,399,

Symbols with ASCII Code <=32 doesn't count as a character for the checker code. Shortest code wins.

Note: We encourage you not to use comments in your code for this type of problem

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

This is because "anana" is a 5 character substring of "banana"

Editor Image

?