Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Reference solution appears to have bug when both hands have one or two pairs. I debugged my own solution quite exhaustively, and could not find mistakes.
I could submit after some trying and getting favourable random tests, and I could not figure out exactly what the reference solution is doing wrong ( or at all ).
So I might be wrong, but I doubt it. Marking as
Issue
because it probably is.Initial code is self-contradictory:
The comment is incorrect.
duplicate
(if your language isn't available with this one, you should rather do it's translation than create a new one)
This comment is hidden because it contains spoiler information about the solution
Random test says
Wiki says "In games where more than five cards are available to each player, the best five-card combination of those cards must be played", so my solution selects second hand as having a flush of
JC 8C 2C 5C 7C
.This looks interesting, but I'm struggling to understand the Poker rules.
The Wikipedia link shows 5-card hands and explains their ranking. But the tests seem to also test for 7-card hands. How do all those concepts translate? Is there a 3 pair, for example?
Also, the second big hand should probably read "8C 6C 5C JC 7C 9C 10C" (instead of "8C 4..") so that it is actually a straight.