aboutsummaryrefslogtreecommitdiff
path: root/src/2015/day16/aoc.cpp
blob: 9d1ac4afae6790124bb4f877e951310d4b3585ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "aoc.h"
namespace aoc2015 {

bool like(const sue& s1, const sue& s2) { return s1.like(s2); }
bool like_range(const sue& s1, const sue& s2) { return s1.like_range(s2); }

std::pair<int, int> day16(line_view file) {
  aunts as;
  per_line(file, [&as](line_view lv) {
    as.parse(lv);
    return true;
  });

  sue x{3, 7, 2, 3, 0, 0, 5, 3, 2, 1};
  return {as.filter(x, like), as.filter(x, like_range)};
}
} // namespace aoc2015