fork download
  1. Q = A => A.length<=1? A :[
  2. ...Q(A.filter((x,i)=> i>0 && x<A[0]))
  3. ,A[0],
  4. ...Q(A.filter((x,i)=> i>0 && x>=A[0]))];
  5.  
  6.  
  7. A = [...Array(12)].map(()=>~~(Math.random()*99));
  8. console.log("in: "+A + "\nout: "+Q(A));
  9.  
Success #stdin #stdout 0.09s 30048KB
stdin
Standard input is empty
stdout
in:  28,76,55,70,7,4,27,11,92,35,44,48
out: 4,7,11,27,28,35,44,48,55,70,76,92