Class SolveExpress20171222Task

  • All Implemented Interfaces:
    AnnotatedAntTask, AntTaskLogMethods, AntTaskMixIn, ClasspathDelegateAntTask, ConfigurableAntTask, Cloneable

    @AntTask("solve-express-2017-12-22")
    public class SolveExpress20171222Task
    extends AbstractTask
    Ant Task to solve Riddler Express

    From Jeffrey Hope, open up your junk drawer and pull out those decks of cards:

    Your challenge is to take any 50 cards from a standard 52-card deck and arrange them into 10 poker hands, one of each type from a royal flush down to a lowly high card.2 The hands you build always rank as the highest type of hand possible,3 and a card may not be reused across the hands. (This means, for example, that a four-of-a-kind better than four nines is impossible because it’d use a card you’d need to make a royal flush.) As in actual poker, it doesn’t matter what order the cards are arranged within a hand.

    Sounds easy enough, and indeed there is more than one solution. But: Exactly how many solutions are there?

    <solve-express-2017-12-22 classname="String" classpathref="Reference" description="String" taskname="String">
      <classpath .../>
    </solve-express-2017-12-22>
    
    Ranking       Hand
    ----------------------------------------
    RoyalFlush    [A-♤, K-♤, Q-♤, J-♤, 10-♤]
    StraightFlush [K-♡, Q-♡, J-♡, 10-♡, 9-♡]
    FourOfAKind   [8-♤, 8-♡, 8-♢, 8-♧, J-♧]
    FullHouse     [A-♡, A-♢, A-♧, K-♢, K-♧]
    Flush         [Q-♢, J-♢, 10-♢, 9-♢, 7-♢]
    Straight      [7-♤, 6-♤, 5-♤, 4-♤, 3-♤]
    ThreeOfAKind  [6-♡, 6-♢, 6-♧, 10-♧, 5-♧]
    TwoPair       [9-♤, 9-♧, 7-♡, 7-♧, 4-♡]
    Pair          [5-♡, 5-♢, 4-♢, 4-♧, 3-♡]
    HighCard      [Q-♧, 3-♢, 3-♧, 2-♤, 2-♡]
    Remaining     [2-♢, 2-♧]
    
    Author:
    Allen D. Ball