I'm just getting my feet wet with Linq and IEnumerable, and I'm needing help in trying to determine if my objects contain matches for a card game. I think if I get the first one figured out, the other match checking I need to do will fall in place.
public class Card
{
pubic int Value { get; set; }
public Card(int value)
{
this.Value = value;
}
}
public bool IsCompletedSet(List<Card> cards)
{
var cardValueGroups = cards.GroupBy(card => card.Value);
//How do I determine that there are now exactly two groups of cards
//and that each group contains exactly 3 cards each?
}