title: How do I count objects by attribute value?
body: <p>Part 1. I have an object called Cards. It has Name, Suit and Value attributes (Jack, Diamonds, 2). I want to count if a player has four-of-a-kind (4 cards have the same Name attribute). How can this be accomplished? I'm looking for an efficient algorithm.</p>
  
  <p>Part 2. I need an algorithm for finding 5 cards in a row of the same suit (i.e. 7, 8, 9, 10, jack of hearts). Many thanks in advance to all you smart folks out there! </p>
  
  <p>To clarify, each player is dealt 8 cards total. Player (object) has an attribute called Hand which is a list of Cards [object]. </p>