LCS  Longest Common Substring
A string is finite sequence of characters over a nonempty finite set Σ.
In this problem, Σ is the set of lowercase letters.
Substring, also called factor, is a consecutive sequence of characters occurrences at least once in a string.
Now your task is simple, for two given strings, find the length of the longest common substring of them.
Here common substring means a substring of two or more strings.
Input
The input contains exactly two lines, each line consists of no more than 250000 lowercase letters, representing a string.
Output
The length of the longest common substring. If such string doesn't exist, print "0" instead.
Example
Input: alsdfkjfjkdsal fdjskalajfkdsla Output: 3
Notice: new testcases added
hide comments
nayeem_joy:
20200406 20:30:06
Just Use O(nlogn) + lcp ,get AC 

fahimcp495:
20191231 08:07:27
finally AC using suffix automaton. 

yaswanth:
20191013 20:58:35
Got TLE with Suffix array with storing temp results (partial ordering array). Had to change it to get AC. Too strict of a time limit. 

beingbmc:
20190924 12:51:06
NLogN suffix array works with cpp but TLE with Java 

mac1309:
20190726 13:30:09
its so bad that suffix array in O(nlog^2n) is giving tle


tuilathao:
20190724 18:42:47
oh ye


tuilathao:
20190724 18:41:31
ye


mwx36mwx:
20180526 10:33:53
manbermyers works for me :) 

cold_chair:
20171208 11:26:37
As the example of Suffix automation,this problem is so classic! 

Rajivteja:
20171108 05:42:15
O(NlogN) suffix array won't work. You need to implement the O(N) suffix tree/suffix automaton for this. 
Added by:  Bin Jin 
Date:  20070924 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 CPP 