Card Game Score
InterviewTime limit1sMemory limit128 MB
Given five playing cards with color and number, compute a poker-like score by checking a fixed priority list of hand patterns.
- Level
Easy3 of 10
- Topics
- Simulation, Implementation, Hash map
- Solved
- No attempts yet
Problem
A card game uses 36 cards. Each card has one of four colors, R, B, Y, or G, and one number from 1 through 9. There are nine cards of each color.
Five cards are given. Compute the score by applying the highest-scoring rule that matches the hand.
If more than one rule applies, the card game's score is the highest possible score.
Input
Five lines are given. Each line contains one card's color and number separated by a single space.
Output
Print the card hand's score on one line.