If a larger connected component is found this function is called to store information about that component .
def reset_result ( key , input ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT for j in range ( m ) : NEW_LINE INDENT if ( visited [ i ] [ j ] != 0 and input [ i ] [ j ] == key ) : NEW_LINE INDENT result [ i ] [ j ] = visited [ i ] [ j ] ; NEW_LINE DEDENT else : NEW_LINE INDENT result [ i ] [ j ] = 0 ; NEW_LINE DEDENT DEDENT DEDENT DEDENT