#include "aoc.h" #include namespace aoc2022 { std::pair day12(line_view file) { int row{0}; heightmap hm; per_line(file, [&hm, &row](line_view lv){ hm.load(row++, lv); return true; }); hm.flood(hm.start); int a1 = hm.was(hm.end); hm.reset(); // hm.print(); int a2{INT32_MAX}; hm.flood_down(hm.end, &a2); return {a1, a2}; } }