Longest Palindrome

0

0 votes
String Algorithms, String
Problem

A palindrome is a sequence that reads the same backwards as forwards, e.g. madam.

Your task here is to find the length of longest substring which is pallindrome in the given string.

INPUT:

  • First-line will take T as the only input. T-test cases.
  • Next T line will take S as input. will only be composed of small latin alphabets i.e. [a,...,z].

OUTPUT:

Print T lines - maximum length of palindromic substring.

CONSTRAINTS:

  • 1 ≤ T ≤ 100
  • 1 ≤ S ≤ 100000
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?