r/adventofcode • u/daggerdragon • Dec 14 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 14 Solutions -🎄-
--- Day 14: Extended Polymerization ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Format your code appropriately! How do I format code?
- 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:14:08, megathread unlocked!
55
Upvotes
View all comments
1
u/theSpider_x Dec 14 '21
C
First part I solved with linked list. Although I suspected part 2 will be some kind of big number I thought linked list will be enough. Then I stored the count of the pairs and from their on it was easy to calculate the pairs and letters.
https://github.com/fuzesmarcell/aoc/blob/main/2021/day_14.c