fork download
  1. QS = X=>X.length<=1? X:[
  2. ...QS(X.filter((x,i)=>i>0&&x<X[0]))
  3. ,X[0],
  4. ...QS(X.filter((x,i)=>i>0&&x>=X[0]))];
  5.  
  6.  
  7. X=[...Array(20)].map(()=>Math.floor(Math.random()*100));
  8. console.log("in: "+X + "\nout: "+QS(X));
Success #stdin #stdout 0.04s 122240KB
stdin
Standard input is empty
stdout
in:  28,2,63,38,18,70,18,15,51,0,81,4,57,32,95,27,53,17,36,42
out: 0,2,4,15,17,18,18,27,28,32,36,38,42,51,53,57,63,70,81,95