check for sub - string of length 2.
start = 0 NEW_LINE i = 0 NEW_LINE while i < n - 1 : NEW_LINE INDENT if ( st [ i ] == st [ i + 1 ] ) : NEW_LINE INDENT table [ i ] [ i + 1 ] = True NEW_LINE start = i NEW_LINE maxLength = 2 NEW_LINE DEDENT i = i + 1 NEW_LINE DEDENT