Question: C++ question Function to determine whether a poker hand is straight. (We assume that the poker is entered in ascending order of the number represented)

C++ question Function to determine whether a poker hand is straight. (We assume that the poker is entered in ascending order of the number represented)

Rules

  • (1) Poker from A to 10 is the int number from 1 to 10 and J?11 Q?12 K?13

and we use the number 0 to represent two jokers.

  • (2) Except for the jokers, which are two, all other cards are four and do not take into account the suit symbols, two jokers can replace any other card.
  • (3) The longest straight is from [A, 2, 3, 4 ......10, J, Q, K, A], no straight can have a duplicate card except for the longest straight
  • (4) Any straight is a subsequence of the longest straight.
C++ question Function to determine whether a poker hand is straight. (We

Sample output (v represent the sequence is straight, X is not straight, the number represent the rule) [4, 4, 5, 5, 6] [3,0,5,0,7] [3,0,5,6,7] [10, J, Q, K, A] U, Q, K, A, 2]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!