We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It is usually the case that Aces can be high or low card depending on whether that is useful for making a straight. In which case a hand with A 2 3 4 5 is considered a 5 high straight. This is fairly standard for poker rules. It was not mentioned in the problem statement, but using this option on the Ace is necessary to pass all of the test cases, specifically case 6.
Project Euler #54: Poker hands
You are viewing a single comment's thread. Return to all comments →
It is usually the case that Aces can be high or low card depending on whether that is useful for making a straight. In which case a hand with A 2 3 4 5 is considered a 5 high straight. This is fairly standard for poker rules. It was not mentioned in the problem statement, but using this option on the Ace is necessary to pass all of the test cases, specifically case 6.
yup it is!