What is Nostr?
jpages /
npub1mr0…k4s2
2023-12-15 22:52:26

jpages on Nostr: Advent of Code - Day 15 Part 1 : 1h02:01 (rank 8098) Part 2 : 1h50:35 (rank 7297) An ...

Advent of Code - Day 15

Part 1 : 1h02:01 (rank 8098)
Part 2 : 1h50:35 (rank 7297)

An easy and very instructive problem, that describes hashmaps internals.

Part 1 can be solved with a one-liner, thanks to the foldLeft() method.

In Part 2, I struggled a bit to understand in which box the lenses should be put in. I had not noticed the sentence "The result of running the HASH algorithm on the label indicates the correct box for that step".

#AdventOfCode
Author Public Key
npub1mr0wam5le7yta87mshdg2jrflgv9t0fq6gl4gkvaejw54k6z78gq9ek4s2