Case - 3 :
elif ( len ( neg ) >= 2 ) : NEW_LINE INDENT negMax = - sys . maxsize NEW_LINE negMaxIdx = - 1 NEW_LINE negMin = sys . maxsize NEW_LINE negMinIdx = - 1 NEW_LINE for i in range ( len ( neg ) ) : NEW_LINE INDENT if ( abs ( arr [ neg [ i ] ] ) > negMax ) : NEW_LINE INDENT negMaxIdx = neg [ i ] NEW_LINE negMax = abs ( arr [ negMaxIdx ] ) NEW_LINE DEDENT DEDENT for i in range ( len ( neg ) ) : NEW_LINE INDENT if ( abs ( arr [ neg [ i ] ] ) < negMin and neg [ i ] != negMaxIdx ) : NEW_LINE INDENT negMinIdx = neg [ i ] NEW_LINE negMin = abs ( arr [ negMinIdx ] ) NEW_LINE DEDENT DEDENT res . append ( arr [ negMinIdx ] ) NEW_LINE res . append ( arr [ negMaxIdx ] ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( i != negMinIdx and i != negMaxIdx ) : NEW_LINE INDENT res . append ( arr [ i ] ) NEW_LINE DEDENT DEDENT for i in range ( len ( res ) ) : NEW_LINE INDENT print ( res [ i ] , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT