normalize
This commit is contained in:
parent
42feac3994
commit
798e7ecd13
14
src/day3.cpp
14
src/day3.cpp
@ -7,15 +7,13 @@
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
using Data = std::string;
|
||||
|
||||
int64_t part_1(const std::vector<Data> &);
|
||||
int64_t part_2(const std::vector<Data> &);
|
||||
int64_t part_1(const std::vector<std::string> &);
|
||||
int64_t part_2(const std::vector<std::string> &);
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"input/2025-3.txt"};
|
||||
Data line;
|
||||
std::vector<Data> v;
|
||||
std::string line;
|
||||
std::vector<std::string> 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<Data> &v) {
|
||||
int64_t part_1(const std::vector<std::string> &v) {
|
||||
int64_t ans{};
|
||||
for (auto d : v) {
|
||||
ans += solve(d, 2);
|
||||
@ -50,7 +48,7 @@ int64_t part_1(const std::vector<Data> &v) {
|
||||
return ans;
|
||||
}
|
||||
|
||||
int64_t part_2(const std::vector<Data> &v) {
|
||||
int64_t part_2(const std::vector<std::string> &v) {
|
||||
int64_t ans{};
|
||||
for (auto d : v) {
|
||||
ans += solve(d, 12);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user