Find the indices of the minimum and the maximum value
val1 = sys . maxsize ; mini = - 1 ; NEW_LINE val2 = - sys . maxsize ; maxi = - 1 ; NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( a [ i ] < val1 ) : NEW_LINE INDENT mini = i ; NEW_LINE val1 = a [ i ] ; NEW_LINE DEDENT if ( a [ i ] > val2 ) : NEW_LINE INDENT maxi = i ; NEW_LINE val2 = a [ i ] ; NEW_LINE DEDENT DEDENT flag = 1 ; NEW_LINE