[algogeeks] Re: What is the algorithm for this problem

2014-07-09 Thread Don
// This function returns the number of hints required to // determine the order of the cards. // Parameter int c[n] specifies n cards which are provided // in an unknown order. Each card is represented as a 10-bit field // with two bits set, one representing the color of the card and the // other r

[algogeeks] Re: What is the algorithm for this problem

2014-07-09 Thread Don
Here is a fairly simple way to find a solution. Make a list of each pair of the n cards which have been selected. This list can include up to 300 pairs. Represent each card as a 10-bit value where each bit represents one particular color or value. Thus, each card will have two bits set. Each pa