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:
- Track the motion of a rope with 2 knots (Part 1)
- Track the motion of a rope with 10 knots (Part 2)
- 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.
Navigation
- Problem Description: Detailed description of the day's challenge
- Solution Explanation: Walkthrough of the approach used
- Code: The complete implementation with comments