pushing right adjacent element for index 'k
' NEW_LINE INDENT if ( k + 1 <= len ( s ) - 1 and edge [ ord ( s [ k ] ) - 97 ] [ ord ( s [ k + 1 ] ) - 97 ] == 0 ) : NEW_LINE INDENT gr [ ord ( s [ k ] ) - 97 ] . append ( ord ( s [ k + 1 ] ) - 97 ) NEW_LINE edge [ ord ( s [ k ] ) - 97 ] [ ord ( s [ k + 1 ] ) - 97 ] = 1 NEW_LINE DEDENT DEDENT