summaryrefslogtreecommitdiffstats
path: root/day01/solution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'day01/solution.cpp')
-rw-r--r--day01/solution.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/day01/solution.cpp b/day01/solution.cpp
index 9fb9ec1..33b7550 100644
--- a/day01/solution.cpp
+++ b/day01/solution.cpp
@@ -13,9 +13,7 @@ auto parse_input(std::istream& is) {
13 std::vector<int> document; 13 std::vector<int> document;
14 for (auto const line : lines) { 14 for (auto const line : lines) {
15 char direction = line[0]; 15 char direction = line[0];
16 std::string out; 16 int length = std::stoi(std::ranges::to<std::string>(line | views::drop(1)));
17 ranges::copy(line | views::drop(1), std::back_inserter(out));
18 int length = std::stoi(out);
19 document.push_back(direction == 'R' ? length : -length); 17 document.push_back(direction == 'R' ? length : -length);
20 } 18 }
21 return document; 19 return document;
@@ -54,7 +52,6 @@ void part2(auto const& input) {
54 } 52 }
55 dial %= DIAL_MAX; 53 dial %= DIAL_MAX;
56 old_dial = dial; 54 old_dial = dial;
57 std::cerr << answer << ' ' << dial << '\n';
58 } 55 }
59 std::println("{}", answer); 56 std::println("{}", answer);
60} 57}