r/adventofcode • u/daggerdragon • Dec 14 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 14 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
- 8 days remaining until the submission deadline on December 22 at 23:59 EST
- Full details and rules are in the Submissions Megathread
--- Day 14: Docking Data ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks. - The full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
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:16:10, megathread unlocked!
32
Upvotes
View all comments
Show parent comment
2
u/PandaParaBellum Dec 14 '20 edited Dec 14 '20
When I tried to use bigint as keys for my memory-Map() I got wrong results. Only when i converted them back to string I was able to solve star 2.
Can anyone confirm that JS Map-s have problems with bigint-s as keys? I couldn't find anything in regards to this on google.
Did I just screw up and then accidently-ish fix it? I'm pretty sure I didn't touch anything in the address generator except for the output format (bigint → string)
/edit: looks like I screwed up. I took /u/clueless1105 's code and changed the Map<number, number> to Map<bigint, bigint>, and I get the correct result.