This commit is contained in:
Eric Mertens 2023-12-04 19:32:38 -08:00
parent c86e71ec09
commit 8c3b0ad0cf

View File

@ -50,8 +50,12 @@ auto CountWins(std::vector<Card>& cards) -> std::vector<std::size_t>
{ {
std::sort(card.mine .begin(), card.mine .end()); std::sort(card.mine .begin(), card.mine .end());
std::sort(card.winners.begin(), card.winners.end()); std::sort(card.winners.begin(), card.winners.end());
auto const c = std::set_intersection(card.mine.begin(), card.mine.end(), card.winners.begin(), card.winners.end(), Counter<std::size_t>{}); auto const counter =
result.push_back(c); std::set_intersection(
card.mine .begin(), card.mine .end(),
card.winners.begin(), card.winners.end(),
Counter<std::size_t>{});
result.push_back(counter);
} }
return result; return result;