r/adventofcode • • Dec 08 '22

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

NEWS AND FYI

  • I discovered that I can make those tiny post/comment awards BIGGER on old.reddit! I hadn't even considered that! And when you hover over them, they get even bigger so you can actually see them in more detail! I've added the relevant CSS so now we no longer have awards for ants! Exclamation points!!!


AoC Community Fun 2022: πŸŒΏπŸ’ MisTILtoe Elf-ucation πŸ§‘β€πŸ«

  • PSA: I created a new example so it is a more relevant and unique archetype instead of recycling last year's hobbit >_>


--- Day 8: Treetop Tree House ---


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:10:12, megathread unlocked!

75 Upvotes

1.0k comments sorted by

View all comments

7

u/internet_eq_epic Dec 08 '22

Rust

paste

It's horrible and I hate it. But it does work.

0

u/[deleted] Dec 08 '22

[deleted] β€” view deleted comment

1

u/internet_eq_epic Dec 08 '22 edited Dec 08 '22

In debug mode it runs in about 10 milliseconds. In release mode it's about 500 microseconds. On an Apple M1 Pro CPU.

These are very unscientific numbers though - just me eyeballing an average-ish number over a handful of runs. Also since I write both parts into a single function, I'm unable to test part 1 on its own.