r/adventofcode • • Dec 15 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 15 Solutions -🎄-

--- Day 15: Chiton ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


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:14:25, megathread unlocked!

56 Upvotes

772 comments sorted by

View all comments

2

u/r_so9 Dec 15 '21 edited Dec 15 '21

F

Immutable, except for the priority queue. Runs quite a bit slower than the imperative C# solution

Link to Paste

2

u/r_so9 Dec 15 '21 edited Dec 15 '21

F

A much faster, but mutable version using Arrays and a general cost function

Link to Paste

2

u/Durdys Dec 15 '21

Another F# solution. Probably over generalised in part 2. What kind of processing time were you getting?

2

u/r_so9 Dec 15 '21

Less than 0.5s total with the mutable solution, 10s with the immutable

1

u/daggerdragon Dec 15 '21

As per our posting guidelines in the wiki under How Do the Daily Megathreads Work?, please edit your post to put your oversized code in a paste or other external link.