diff --git a/src/day7.cpp b/src/day7.cpp index 821668f..84b4e7d 100644 --- a/src/day7.cpp +++ b/src/day7.cpp @@ -79,8 +79,8 @@ uint64_t part_2(const Grid &grid) { using namespace std::ranges; auto view = iota_view{start_row, grid.size()}; std::map starting_cols{{start_col, 1}}; - auto cols = fold_left(view, starting_cols, [&grid](auto acc, auto row) { - return fold_left(acc, std::map{}, + auto cols = fold_left(view, starting_cols, [&grid](auto cols, auto row) { + return fold_left(cols, std::map{}, [&grid, &row](auto next_cols, auto col_cnt) { auto [col, cnt] = col_cnt; if (at_loc(grid, row, col) == '^') {