Day 7: No Space Left On Device [AOC2022 Python]

Published: 07 December 2022
on channel: 0xdf
762
23

In this challenge, I'm asked to parse a bunch of terminal output to track how much stuff is in various directories on a file system. First I'm asked to find the sizes of all directories under a given size, and then asked to find the smallest directory that I could delete to allow a given amount of space on the disk.

Code 2022 AOC: https://gitlab.com/0xdf/aoc2022
Challenge Link: https://adventofcode.com/2022/day/7

☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf

#adventofcode #python

[00:00] Introduction
[00:12] Part 1 description
[01:34] Strategy / input analysis
[02:58] Looping over lines, creating tokens to switch on
[04:55] Processing lines with size / file
[07:33] Running on example, noticing missing cd code
[08:47] Adding code to track current directory
[09:53] Troubleshooting path size tracking
[11:54] Calculating part 1 solution
[13:30] Part 2 desription
[14:00] Calculating size to be deleted
[15:28] Finding dir to be deleted, solving part 2
[16:12] Part 2 summary


On this page of the site you can watch the video online Day 7: No Space Left On Device [AOC2022 Python] with a duration of hours minute second in good quality, which was uploaded by the user 0xdf 07 December 2022, share the link with friends and acquaintances, this video has already been watched 762 times on youtube and it was liked by 23 viewers. Enjoy your viewing!