Q = A => A.length<=1? A :[...Q(A.filter((x,i)=> i>0 && x<A[0])),A[0],...Q(A.filter((x,i)=> i>0 && x>=A[0]))]; A = [...Array(12)].map(()=>~~(Math.random()*99));console.log("in: "+A + "\nout: "+Q(A));
Standard input is empty
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!