Returns length of the longest prefix which is also suffix and the two do not overlap . This function mainly is copy of computeLPSArray ( ) in KMP Algorithm
int LengthlongestPrefixSuffix ( string s ) { int n = s . length ( ) ; int lps [ n ] ;