Calculate the minimum distances to any rotten orange from all the fresh oranges
for i in range ( R ) : NEW_LINE INDENT for j in range ( C ) : NEW_LINE INDENT if ( arr [ i ] [ j ] == 1 ) : NEW_LINE INDENT Distance ( arr , i , j ) NEW_LINE DEDENT DEDENT DEDENT