← 返回 rippling 的题目列表Compare Two Partially Received Hands: win/lose/tie/unknown
类型:online_judge
Problem: Compare Two Partially Received Hands: win/lose/tie/unknown
Based on the previous hand-comparison problem, assume that due to network issues each player's hand may be partially received (some cards are unknown).
Given the currently known cards for both players, return one of:
user1 (user1 is guaranteed to win)
user2 (user2 is guaranteed to win)
tie (guaranteed tie)
unknown (outcome depends on how the unknown cards are completed)
Input
partialHand1, partialHand2: arrays of known card strings for each player.
The remaining cards are unknown.
Same card encoding and ranking rules as in Problem 1.
Output
One of: user1 / user2 / tie / unknown (exact tokens per prompt).
Key idea
Compute each player’s best possible and worst possible strength ranges given unknown cards.
If one player’s worst-case still beats the other’s best-case, the winner is determined.
Otherwise return unknown (or tie if both are forced to tie).
Example
Input
(depends on provided rules/encoding + missing-card representation)
Output
unknown