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

View File

@ -48,10 +48,14 @@ auto CountWins(std::vector<Card>& cards) -> std::vector<std::size_t>
for (auto& card : cards)
{
std::sort(card.mine.begin(), card.mine.end());
std::sort(card.mine .begin(), card.mine .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>{});
result.push_back(c);
auto const counter =
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;