Day 9: Rope Bridge

Day 9 involves simulating the motion of a rope with multiple knots based on a series of movement commands.

Problem Overview

You're crossing a rope bridge but need to model the rope's movement. The rope consists of a series of knots connected in a line. When the head knot moves, the other knots follow according to specific rules. Your task is to:

  1. Track the motion of a rope with 2 knots (Part 1)
  2. Track the motion of a rope with 10 knots (Part 2)
  3. Count the number of unique positions the tail knot visits

This problem tests your ability to simulate physical constraints and track positional state across a sequence of moves.