Skip to content

Commit

Permalink
range v3 example - improved comment
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Läufer <[email protected]>
  • Loading branch information
klaeufer committed Nov 2, 2023
1 parent 1f87ae9 commit 93d78d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modern-cpp/rangev3-aoc2022day1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ std::pair<int, int> most_nutritious_inventories(std::vector<int> 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<int>());

// return top and sum of top n inventory values
Expand Down

0 comments on commit 93d78d5

Please sign in to comment.