LPS  Longest Palindromic Substring
A palindrome is a string that is the same as its reverse. Example "malayalam", "dad", "appa" etc. In this problem you are asked to find the length of the longest contiguous substring of a given string, which is a palindrome.
Input
The first line consists of a single integer N, the no. of characters in the string. 1 <= N <= 100000.
Second line is a string with N characters, where the characters are always lowercase english alphabets, ie 'a' to 'z'.
Output
A single line with an integer representing the length of longest palindromic substring.
Example
Input:
5
ababa
Output:
5
hide comments
lotte10:
20200616 10:13:12
Those who gave a try to solve with hashes, why are you complaining about WA ? That is probably collision, which is pretty obvious 

the_lizard_man:
20200305 15:34:54
tle .. with DP>n^2 

fahimcp495:
20200101 20:43:03
AC using manacher's algo 

maruf_1604089:
20191223 06:29:10
AC in 1 go using Palindrome Tree 

mac1309:
20190727 08:10:57
suffix array implementation ending up in segmentation fault. http://p.ip.fi/IbuM


beingbmc:
20190701 21:49:47
Used manacher's.


ac5769:
20181116 05:27:16
Last edit: 20181116 05:27:40 

sifat_15:
20180919 09:22:09
Hlw, @akash1518


akash1518:
20180828 17:12:12
binary search +hashing (nlogn)


neha__mishra:
20180802 09:46:17
I tried many versions for this problem including dynamic programming but each of them gave wrong answer after test case 16 or 14 or 15 ........ I wonder if the test cases can be downloaded from somewhere or how to know about the critical test cases? 
Added by:  Srivatsan B 
Date:  20090604 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  http://opc.iarcs.org.in/problems/iarcsfeb05ad1 