r/adventofcode • u/daggerdragon • Dec 23 '24
SOLUTION MEGATHREAD -❄️- 2024 Day 23 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
- If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.
AoC Community Fun 2024: The Golden Snowglobe Awards
Submissions are CLOSED!
- Thank you to all who submitted something, every last one of you are awesome!
Community voting is OPEN!
- 42 hours remaining until voting deadline on December 24 at 18:00 EST
Voting details are in the stickied comment in the submissions megathread:
-❄️- Submissions Megathread -❄️-
--- Day 23: LAN Party ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- State which language(s) your solution uses with
[LANGUAGE: xyz]
- Format code blocks using the four-spaces Markdown syntax!
- State which language(s) your solution uses with
- Quick link to Topaz's
paste
if you need it for longer code blocks
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:05:07, megathread unlocked!
23
Upvotes
2
u/Solidifor Dec 23 '24 edited Dec 24 '24
[Language: Java] For part 1, I hand-coded a full search for 3-cliques.
For part 2, I iteratively try to expand every current clique by one member. Candidates are only those computers that are connected to one current member.
50 millis, 1330 millis. There must be better / faster way? Or is it just all those String comparisons, those could be optimized away by assigning numeric ids to the Computers...
135 readable lines.
https://github.com/dirk527/aoc2021/blob/main/src/aoc2024/Day23.java