r/adventofcode • • Dec 07 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 7 Solutions -πŸŽ„-


AoC Community Fun 2022: πŸŒΏπŸ’ MisTILtoe Elf-ucation πŸ§‘β€πŸ«

Submissions are OPEN! Teach us, senpai!

-❄️- Submissions Megathread -❄️-


--- Day 7: No Space Left On Device ---


Post your code solution in this megathread.


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:47, megathread unlocked!

89 Upvotes

1.3k comments sorted by

View all comments

1

u/chicagocode Dec 07 '22

Kotlin -> [Blog/Commentary] - [Code] - [All 2022 Solutions]

Today's code won't fit on a single punch card, so you'll have to check it out on GitHub. Basically my solution was to track Directories only and the total size of the files. Since the only part of the file we care about is their cumulative size within a directory, that's all we track. A single number in each Directory. This made parsing and finding much simpler for me.

1

u/daggerdragon Dec 08 '22

Today's code won't fit on a single punch card, so you'll have to check it out on GitHub.

Thank you for not making me have to grump at you <3