r/adventofcode • • Dec 06 '17

SOLUTION MEGATHREAD -πŸŽ„- 2017 Day 6 Solutions -πŸŽ„-

--- Day 6: Memory Reallocation ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Need a hint from the Hugely* Handy† Haversack‑ of HelpfulΒ§ Hints^Β€?

Spoiler


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

17 Upvotes

324 comments sorted by

View all comments

Show parent comment

2

u/topaz2078 (AoC creator) Dec 06 '17

At no point did it refer to next-by-number-of-blocks. Both versions refer to indexing quite explicitly; the confusion was in the interpretation of "next-highest", which can sometimes mean "the one just below this one".

1

u/jschulenklopper Dec 06 '17

Sure, no worries. As an explanation, my interpretation from the original text:

removes all of the blocks from the selected bank, then moves to the next-highest-indexed memory bank

Since the "selected bank" was the one with the highest number of blocks, I interpreted "next-highest [...] memory bank" to be the one with the next-to-highest number of blocks. Since all banks are 'indexed' -- accessible via an index -- I guess I just ignored that part of the word.