function compareHands(hand1, hand2) {
  const handScore1 = handScoringHelper(hand1);
  const handScore2 = handScoringHelper(hand2);
  // In descending order of group size, decide if one hand is better.
  for (let group = GAME_STATE.num_cards_per_hand - 1; group >= 0; group--) {
    if (handScore1[group] > handScore2[group]) {
      return 1;
    }
    if (handScore1[group] < handScore2[group]) {
      return 0;
    }
  }
  // Break a tie by flipping a fair coin.
  if (Math.random() > 0.5) {
    return 1;
  }
  return 0;
}
Returns 1 if hand1 beats hand2, in terms of hand value.
Returns 0 if hand1 is less than hand2.
In the event of a tie, return 0 or 1 randomly with even odds.
@param {number[]} hand1 ordered list of numbers representing Player 1's hand.
@param {number[]} hand2 ordered list of numbers representing Player 2's hand.
@returns {number} 1 or 0 indicating Player 1's win or loss, respectively.