diff --git a/snippets/bucketSort.md b/snippets/bucketSort.md index 56cde5756..8cb8471f5 100644 --- a/snippets/bucketSort.md +++ b/snippets/bucketSort.md @@ -18,11 +18,9 @@ const bucketSort = (arr, size = 5) => { { length: Math.floor((max - min) / size) + 1 }, () => [] ); - arr.forEach(val => { buckets[Math.floor((val - min) / size)].push(val); }); - return buckets.reduce((acc, b) => [...acc, ...b.sort((a, b) => a - b)], []); }; ```