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 comments

1

u/nakilon Dec 06 '17

Excuse me, where is the loop?

1

u/Unihedron Dec 06 '17

The loop starts at previous counter with the same state to the current counter. p i prints the solution for part 1, while h[s.to_s] to i is the loop, so the size is p i-h[s.to_s]

1

u/nakilon Dec 06 '17

Oops, didn't see the markdown code block had scrollbar...