Skip to content

Commit

Permalink
Add day 23 of year 2024 🍪
Browse files Browse the repository at this point in the history
  • Loading branch information
letelete committed Dec 24, 2024
1 parent e184738 commit fe8d6f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions 2024/days/day-23/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Memory: 18.00 GB

## Sample 1

| part | time (~) | μs |
| ---- | -------- | ------------------ |
| 1 | 15.51ms | 15.505959000000004 |
| 2 | 0.67ms | 0.6694579999999917 |
| part | time (~) | μs |
| ---- | -------- | ----------------- |
| 1 | 16.94ms | 16.93887500000001 |
| 2 | 0.66ms | 0.662542000000002 |

## Answer

| part | time (~) | μs |
| ---- | -------- | ------------------ |
| 1 | 22.17ms | 22.172333999999992 |
| 2 | 8.70ms | 8.701333000000005 |
| 1 | 22.48ms | 22.476917000000014 |
| 2 | 10.45ms | 10.454000000000008 |
2 changes: 1 addition & 1 deletion 2024/days/day-23/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function findLargestGroup(graph) {
*/
const choosePivot = (P, X) => {
const candidates = [...union(P, X)];
return candidates[Math.floor(candidates.length / 2)];
return candidates[Math.floor(Math.random()) * (candidates.length - 1)];
};

/**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A repository containing my [Advent of Code](https://adventofcode.com/) solutions

### Recent year

[![year 2024, 40 out of 50 stars](https://progress-bar.xyz/40/?title=2024%20•%2040/50%20⭐%20&scale=50&style=square)](./2024)
[![year 2024, 42 out of 50 stars](https://progress-bar.xyz/42/?title=2024%20•%2042/50%20⭐%20&scale=50&style=square)](./2024)

### Archive

Expand Down

0 comments on commit fe8d6f1

Please sign in to comment.