aboutsummaryrefslogtreecommitdiff
path: root/src/2021/day9/aoc.cpp
blob: d4297ac620d3aa010ffcc927d18509cdb48a4e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "aoc.h"

namespace aoc2021 {
int heightmap::areas[grid * grid] = {0};
std::pair<int, int> day9(line_view file) {
  heightmap hm;
  int r{0};
  per_line(file, [&r, &hm](line_view lv){
    hm.load(r, lv);
    r++;
    return true;
  });

  return {hm.risks(), hm.top3()};
}

}