Here we are getting number of smaller and greater elements of k .
for i in range ( n ) : NEW_LINE INDENT if ( arr [ i ] < k ) : NEW_LINE INDENT num_min += 1 NEW_LINE DEDENT elif ( arr [ i ] > k ) : NEW_LINE INDENT num_max += 1 NEW_LINE DEDENT DEDENT