Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please keep simple and efficient new to coding. maybe using public enum type? Background Set is a game played with 34 cards. The cards contain
Please keep simple and efficient new to coding.
maybe using public enum type?
Background Set is a game played with 34 cards. The cards contain diamonds, squiggles, or ovals. This symbols are drawn using either a solid, striped, or open fill style. Each symbol's color is either red, green, or magenta. On a given card, all symbols are of the same type, same color, and have the same fill style. To make a set, you need three cards for which all characteristics are either the same or pairwise different. For instance, cards where the first shows striped red ovals, the second shows striped green squiggles, and the third shows striped magenta diamonds form a set. They show ovals, squiggles, and diamonds (each shows a different shape); they use colors red, green, and magenta (different colors); and lastly, they all share the same fill style: striped. The Task Write a program that finds all sets that can be made from twelve given cards. Sample Input and Output Input The input to your program will consist of lines, each containing strings representing cards, each consisting of four characters where corresponding to the number of symbols. corresponding to diamonds (D), squiggles (S), and ovals (O). corresponding to solid (S), striped (T), and open (O) fill styles. corresponding to red (R), green (G), and magenta (M). Think of the cards as being arranged in the input as follows: Output all sets you can find, one per line. For each set, output the numbers of the card in the set in sorted order. The sets should be listed in sorted order using the number of their first card, breaking ties using the numbers of the second and third card in the set. If no sets can be formed, output "no sets". (Do not include any punctuation.) The sample input/output corresponds to the illustration. Sample Input and Output Sample Input 3DTG 3DOM 2DSG 1SOM 1DTG 2OTR 3DOR 3STG 2DSM 3SSM 3OTG 1DTM Sample Output 123567897781011121291211Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started