You are viewing a single comment's thread. Return to all comments →
Simplest JavaScript solution
arr.reduce((p,c,i) => { if (c < arr[0]) p[0].push(c); if (c === arr[0]) p[1].push(c); if (c > arr[0]) p[2].push(c); return p; }, [[], [], []]).flat();
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 1 - Partition
You are viewing a single comment's thread. Return to all comments →
Simplest JavaScript solution