Insert into the set
s . add ( a [ i ] ) ; k -- ; } } if ( k > 0 ) { document . write ( X + " " + " " + " " ) ; return ; } s = [ ... s ] . sort ( ( a , b ) => a - b ) for ( let it of s ) { document . write ( it + " " ) ; } document . write ( " " ) ; }