diff --git a/modern-cpp/rangev3-aoc2022day1.cpp b/modern-cpp/rangev3-aoc2022day1.cpp index 01dfa07..03464b3 100644 --- a/modern-cpp/rangev3-aoc2022day1.cpp +++ b/modern-cpp/rangev3-aoc2022day1.cpp @@ -22,7 +22,7 @@ std::pair most_nutritious_inventories(std::vector const& data, co // return error value if there are fewer than n inventories if (size(inventories) < n) return std::make_pair(-1, -1); - // sort just enough to obtain largest n inventories + // sort just enough in descending order to obtain largest n inventories nth_element(inventories, begin(inventories) + n, std::greater()); // return top and sum of top n inventory values