Day 14: Regolith Reservoir

Day 14 involves simulating falling sand in a cave system with rock formations.

Problem Overview

You're mapping out a cave with rock structures and need to simulate how sand will fall and accumulate. The key elements are:

  1. Rock formations are represented as lines in the input
  2. Sand falls from a specific source point (500, 0)
  3. Each sand unit follows specific movement rules until it comes to rest or falls into the abyss
  4. For Part 1, you need to count how many sand units come to rest before sand starts falling into the abyss
  5. For Part 2, a floor is added, and you need to count how many sand units it takes to block the source

This problem tests your ability to simulate physical processes and handle grid-based representations of a 2D space.