← Back to Index

Day 7: Part 2

Problem Description

In this part, the goal was to find the smallest directory that meets certain size criteria. This required a more detailed analysis of the directory sizes calculated in Part 1.

Approach

To tackle this problem, I followed these steps:
1. Reuse Previous Logic: I reused the tree structure and size calculation logic from Part 1 to maintain consistency.
2. Identify Smallest Directory: I traversed the tree again, checking the sizes of directories to find the smallest one that meets the specified criteria.
3. Output: Finally, I printed the size of the smallest directory that meets the criteria.

This approach builds on the previous logic while adding the complexity of finding the smallest directory.

Key Insights

Concepts and Algorithms Used