advent-of-code/2022-python/output
Anders Englöf Ytterström 92df810943 Solve 2022 day 12 pt 1-2
BFS, baby.

2 things got me.

 * S position was not (0,0) in the puzzle input. Such embarrasment to
   loose time over something so stupid.
 * I asumed the elevation was fixed to to increase AND DECREASE by 1.

From the problem description:

> To avoid needing to get out your climbing gear, the elevation of the
> destination square can be at most one higher than the elevation of
> your current square; that is, if your current elevation is m, you
> could step to elevation n, but not to elevation o. _(This also means
> that the elevation of the destination square can be much lower than
> the elevation of your current square.)_

This means elevation only can _increase_ by one,
but _decrease_ with more.

So my wrong code:

0 <= abs(n - e) <= 1

got fixed with:

n - e <= 1

For pt 2, I reused the loop to find S to collect all "a" positions,
and looped them as starting points. Execution time is not the best,
but it works.
2025-11-30 19:17:15 +01:00
..
__init__.py Solve 2022 day 12 pt 1-2 2025-11-30 19:17:15 +01:00
day_01.py Solve 2022 day 1 pt 1-2 2025-11-30 19:17:15 +01:00
day_02.py Solve 2022 day 2 pt 1-2 2025-11-30 19:17:15 +01:00
day_03.py Solve 2022 day 3 pt 1-2 2025-11-30 19:17:15 +01:00
day_04.py Solve 2022 day 4 pt 1-2 2025-11-30 19:17:15 +01:00
day_05.py Solve 2022 day 5 pt 1-2 2025-11-30 19:17:15 +01:00
day_06.py Solve 2022 day 6 pt 1-2 2025-11-30 19:17:15 +01:00
day_07.py Solve 2022 day 7 pt 1-2 2025-11-30 19:17:15 +01:00
day_08.py Solve 2022 day 8 pt 1-2 2025-11-30 19:17:15 +01:00
day_09.py Solve 2022 day 9 pt 1-2 2025-11-30 19:17:15 +01:00
day_10.py Solve 2022 dat 10 pt 1-2 2025-11-30 19:17:15 +01:00
day_11.py Solve 2022 Day 22 pt 1-2 2025-11-30 19:17:15 +01:00
day_12.py Solve 2022 day 12 pt 1-2 2025-11-30 19:17:15 +01:00