Day 12: Hill Climbing Algorithm

Day 12 involves finding the shortest path through a grid of varying elevations.

Problem Overview

You need to navigate a heightmap representing a hilly area, finding the shortest path from a starting position to an ending position. The key constraints are:

  1. You can only move to adjacent squares that are at most one unit higher than your current position
  2. You can move to squares of any lower elevation
  3. For Part 1, you need to find the shortest path from a specific starting point to a specific ending point
  4. For Part 2, you need to find the shortest path from any lowest-elevation square to the ending point

This problem tests your ability to implement pathfinding algorithms, specifically breadth-first search (BFS), on a 2D grid with special movement constraints.