aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/2020/day1/aoc.cpp6
-rw-r--r--src/2020/day1/aoc.h2
-rw-r--r--test/test_2020.cpp4
3 files changed, 8 insertions, 4 deletions
diff --git a/src/2020/day1/aoc.cpp b/src/2020/day1/aoc.cpp
index 87972e7..ab8e2f4 100644
--- a/src/2020/day1/aoc.cpp
+++ b/src/2020/day1/aoc.cpp
@@ -26,13 +26,15 @@ int two_sum(const std::vector<int>& is, int target) {
return 0;
}
-int day1(line_view file, int target) {
+int three_sum(const std::vector<int>& is, int target) { return 0; }
+
+std::pair<int, int> day1(line_view file, int target) {
std::vector<int> is;
per_line(file, [&is](line_view lv) {
is.emplace_back(get_number(lv.line));
return true;
});
- return two_sum(is, target);
+ return {two_sum(is, target), three_sum(is, target)};
}
} // namespace aoc2020
diff --git a/src/2020/day1/aoc.h b/src/2020/day1/aoc.h
index d876d13..d573fb6 100644
--- a/src/2020/day1/aoc.h
+++ b/src/2020/day1/aoc.h
@@ -3,5 +3,5 @@
namespace aoc2020 {
-int day1(line_view, int);
+std::pair<int, int> day1(line_view, int);
}
diff --git a/test/test_2020.cpp b/test/test_2020.cpp
index 72cefc4..f3a8238 100644
--- a/test/test_2020.cpp
+++ b/test/test_2020.cpp
@@ -4,5 +4,7 @@
TEST_CASE("Report Repair", "[2020]") {
line_view lv = load_file("../src/2020/day1/input");
- REQUIRE(1019904 == aoc2020::day1(lv, 2020));
+ auto p = aoc2020::day1(lv, 2020);
+ REQUIRE(1019904 == p.first);
+ REQUIRE(0 == p.second);
}