If there are more than one elements , then initialize min and max
if arr [ 0 ] > arr [ 1 ] : NEW_LINE INDENT minmax . max = arr [ 0 ] NEW_LINE minmax . min = arr [ 1 ] NEW_LINE DEDENT else : NEW_LINE INDENT minmax . max = arr [ 1 ] NEW_LINE minmax . min = arr [ 0 ] NEW_LINE DEDENT for i in range ( 2 , n ) : NEW_LINE INDENT if arr [ i ] > minmax . max : NEW_LINE INDENT minmax . max = arr [ i ] NEW_LINE DEDENT elif arr [ i ] < minmax . min : NEW_LINE INDENT minmax . min = arr [ i ] NEW_LINE DEDENT DEDENT return minmax NEW_LINE