7 kyu
Pokerhand, straight or not?
85 of 594gundii
Loading description...
Algorithms
Lists
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
i'am failed in the secret.
This comment has been hidden.
PHP:
Corrected for PHP for swapped values, more tests will do later Here
Merged the fix for swapped
actual
andexpected
.Looks like in PHP test 14 does not treat like 1.
Should I return true here? UPD: 14 counted as 14 and as 1 simultaneously.
How come the example 2-7-8-5-10-9-11 is straight?? shouldn't it be isNotStraight?
All my tests are passing except test9IsStraight(PokerHandTest). I got a "Runtime Error Occurred". What's the condition to that test??
the 5 card straight (7-8-9-10-11) exists in those 7 cards.
Poker hands consist of 5 cards, as mentioned in the description: "makes up a straight (five cards of sequential rank"
Description is not clear in part of "The number of cards will vary, but will never be more than 7 (the board (5) + player hand (2))". This Kata is not for level 7kuy definitely. Probably for 6kuy.
Java version :
The description says : "The number of cards will vary, but will never be more than 7 (the board (5) + player hand (2))"
And yet, some test case inputs contains 14, 21, 28 elements.... Please fix either description or test cases :)
You're right, was an error in the test. Should be fixed now :)
This comment has been hidden.
Will do!
Added random input
There is still one edge case missing where my solution will fail;-)... Perhaps you find it:-)?!
OK, Use brute force ;-)
Today's last solution, goodbye! :]
Good night;-)! Need 4 more to complete 3000:-)...
I will try :)
I'm curious about it:-)...
Why?
10,11,12,13,14 is a correct sequence. ace isn't 11, stays 14 - description is a little bit unclear;-)
I just don't know more than 5 cards is valid, submit now, passed ;-)
Yes, for me it was a point too;-)... Just saw you solved it with JS - i used C# here (only language some hours ago)...
The description was a bit unclear, sorry about that. The number of cards will be up to 7, becase of the board (5) and player hand (2) :)
I updated the description