Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT s = " abcab " NEW_LINE ans = longestPrefixSuffix ( s ) NEW_LINE if ( ans == " " ) : NEW_LINE INDENT print ( " - 1" ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ans ) NEW_LINE DEDENT DEDENT