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.
For input {3,2,2,3,2,1,1,2,3,3,2,2,5,1,2,2,4,3,3,2,1,2,2,4} my algorithm produces valid solution
[ [ 2, 4, 1, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 1, 6, 5, 2, 3 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 3, 4, 6, 1, 2 ], [ 3, 2, 5, 4, 6, 1 ] ]
yet the test expect
[ [ 2, 1, 4, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 3, 6, 5, 1, 2 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 4, 1, 6, 2, 3 ], [ 3, 2, 5, 4, 6, 1 ] ]
and thus fails.
Problem with the tests is that there might be more than valid solution!
C++: For input {2,2,1,3,2,2,3,1,1,2,2,3,3,2,1,3} my algorithm produces (valid) solution {{1,3,4,2},{4,2,1,3},{3,4,2,1},{2,1,3,4}} yet the test says it's wrong.
Is there a way to get the intended result of the random tests in C++?
I manually checked all the tests hands against my outcome and don't see any fails.
This comment is hidden because it contains spoiler information about the solution
C:
const int[24]
C:
const int[16]
Poker question no. 1:
it("Highest pair wins", function() { assert(Result.loss, "6S AD 7H 4S AS", "AH AC 5H 6H 7S");});
--> Is this an error in the test cases? (the pair is equal: both have a pair of aces)
--> Is this saying that only in case of an equal pair, the suit is relevant? (clubs beats spades)
--> Is this saying that in case of an equal pair, the highest card is deciding? (5 beats 4)
Go preloaded tests are not quite right. It doesn't correctly pick up the set variables
clues
andexpected
. I assume because the examples run after all lines of the Describe are evaluated, so the way it's done it only runs with last clues and examples. Could we move setting these variables inside theIt
?image is broken in the description.
This comment is hidden because it contains spoiler information about the solution
Python (probably other languages also) too: modifying input can influence the random tests: see this
[Python]
Random tests are full of cheaters, e.g.:
There can't be two "three of a kind" with the same cards.
My solution passed, but does not work properly:
my hand "7C 7S 2S 2H AH" wins against "KC KH 5D QS QC".
A test is missing for this case I guess.
This kata is a candidate for retirement as broken: https://github.com/codewars/content-issues/issues/205
Please share your opinion how to handle this broken kata: retire? fix? Something else?
I solved it using python and 7 basic tests pass without a problem, but at "Random coordinates" attempt I get a message "None should equal '11'". Could someone help me understand why this is happening?
Loading more items...