Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

Design a card game for two players. Deal one card at a time, alternating between Player 1 and Player 2, until each player has three cards. Record who receives each card, then report both hands and the result.

Each card has a rank and a suit. Ranks increase from "2" through "10", then "J", "Q", "K", and "A". A hand belongs to one of these categories, from strongest to weakest:

  1. Three of a kind: All three cards have the same rank.
  2. Pair: Exactly two cards have the same rank.
  3. High card: All three cards have different ranks.

The stronger category wins. If both hands have the same category, compare three of a kind by the repeated rank, pairs by the pair rank and then the remaining card (the kicker), and high-card hands by their ranks from highest to lowest. The first unequal rank decides the winner.

Suits do not affect hand strength. If the hands have equal strength, the result is a draw.

Test Cases
Input
Output
Expected