Remove element until a required pair is found
pq . sort ( reverse = False ) NEW_LINE if ( pq [ 0 ] >= 2 * arr1 [ i ] ) : NEW_LINE INDENT ans += 1 NEW_LINE print ( pq [ 0 ] ) NEW_LINE pq . remove ( pq [ 0 ] ) NEW_LINE DEDENT i -= 1 NEW_LINE