Question: Task 3 You are given N cards. Each card consists of a suit and a rank. There are four suits, s ( Spades ) ,
Task
You are given N cards. Each card consists of a suit and a rank. There are four suits, s Spades H Hearts D Diamonds and C Clubs and thirteen ranks, ordered from the lowest to the highest J Jack Q Queen K King and A Ace
Each card is represented by a string in the format For example, of Spades is described as S and Queen of Hearts as QH
There are six ranked card sets described in detail below Sets are ordered by their strength from the weakest to the strongest. Your task is to detect the card sets that can be formed from the given cards.
Detecting each card set is scored separately and is worth an equal number of points. If you detect more than one set, select the strongest one.
Write a function:
Results solution vector &cards ;
that, given an array of strings cards, returns a Results object representing the strongest card set that can be formed.
Assume that the following declarations are given:
struct Results
string setname;
vector selectedcards;
Files
a task
solution....
testinpu...
setname is a string which should be the name of detected set see below;
selectedcards is a list of strings, which should be made of cards that form the detected set. Cards
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
