diff --git a/days/day01.cpp b/days/day01.cpp index 00f759f..ed97b59 100644 --- a/days/day01.cpp +++ b/days/day01.cpp @@ -6,8 +6,8 @@ #include #include -#include #include +#include #include #include @@ -75,8 +75,8 @@ Your actual left and right lists contain many location IDs. What is the total di void day01::Run() { - std::list col1; - std::list col2; + std::vector col1; + std::vector col2; int sum = 0; // std::ifstream input("input/day01.txt"); @@ -101,8 +101,8 @@ void day01::Run() col2.emplace_back(std::stoi(line.substr(delimiterPos + delimiterLength, line.length()))); } - col1.sort(); - col2.sort(); + std::sort(col1.begin(), col1.end()); + std::sort(col2.begin(), col2.end()); for (int i = 0; i < col1.size(); ++i)