diff --git a/src/day3.cpp b/src/day3.cpp index 41d8c77..aaa2366 100644 --- a/src/day3.cpp +++ b/src/day3.cpp @@ -7,15 +7,13 @@ #include #include -using Data = std::string; - -int64_t part_1(const std::vector &); -int64_t part_2(const std::vector &); +int64_t part_1(const std::vector &); +int64_t part_2(const std::vector &); int main() { std::ifstream file{"input/2025-3.txt"}; - Data line; - std::vector v; + std::string line; + std::vector v; while (std::getline(file, line)) { v.push_back(line); } @@ -42,7 +40,7 @@ int64_t solve(const std::string_view line, size_t cnt_to_activate) { return std::stoll(std::string(&max_char) + std::to_string(recur)); } -int64_t part_1(const std::vector &v) { +int64_t part_1(const std::vector &v) { int64_t ans{}; for (auto d : v) { ans += solve(d, 2); @@ -50,7 +48,7 @@ int64_t part_1(const std::vector &v) { return ans; } -int64_t part_2(const std::vector &v) { +int64_t part_2(const std::vector &v) { int64_t ans{}; for (auto d : v) { ans += solve(d, 12);