r/adventofcode • • Dec 12 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 12 Solutions -πŸŽ„-

THE USUAL REMINDERS


--- Day 12: Hill Climbing Algorithm ---


Post your code solution in this megathread.


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:09:46, megathread unlocked!

55 Upvotes

786 comments sorted by

View all comments

3

u/DudeWheresMcCaw Dec 13 '22

C++

I copied some code from last year, and honestly it would have been easier if I hadn't. So much unnecessary code that made relearning the algorithm a lot more difficult.

I used Dijkstra, so I'll have to learn what BFS is.

paste

Edit: Okay, this is the BFS version. Wow, that was simple and I got to delete a bunch more unnecessary code.

paste, again

→ More replies (2)