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.
Got it, thanks
In the input string you have "2" and "200" not "2" and "2"
Have question for the last test case:
'1 2 2 4 4 6 6 7 7 18 27 72 81 9 91 425 31064 7920 67407 96488 34608557 71899703'
should equal
'1 2 200 4 4 6 6 7 7 18 27 72 81 9 91 425 31064 7920 67407 96488 34608557 71899703'
Can anyone explain why the second 2 should be 200? Thanks
Trying to understand the rules for sorting two numbers with the same weight was really confusing because of the wording. I think this is an improvement:
I updated the python version: it now handles 20000 random tests too.
Hi booleangate,
Randomized tests are common practice on codewars on a submit. Just to prevent people from cheating. And I can assure you that there were people who did when I did not have them ;)
The way I do it, I do not any the problem. What I do find a problem is when people generate random input and use there own initial solution for generating 'expected' output. In that way all the bugs, undocumented functionality etc. of the initial solution are from then on 'by design'.
In my daily work I never used randomized tests and I even never use tests with DateTime.Now but only with fixed dates.
Hi,
I had troubles to validate/publish the python translation with 20000 tests (slowes down the navigator "to death"...). That's why I reduced their number. I just modified it to 10000. Seems to work.
@
FrankK
: btw, you never replied to my questions in thesortable poker hand
kata. Could you please take a look?EDIT: Actually... if the validation work in the edit panel with 10000 random tests, impossible to publish it: server times out each time. Tried with 10000, 5000... No way. Passed with 2000.
The issue isn't the number of tests, it's that they are random. You should do the same tests with the same input every time.
This comment is hidden because it contains spoiler information about the solution
I agree. That is why I originally did 20000 random tests with the same range of hands. In that case, there is no chance that hands are NOT tested against each other.
The translator for Python lowered it to 1000 random tests for Python. I don't know why. It still sounds like enough tests to be not 'non deterministic'.
Non deterministic unit test are Bad(TM). Depending on the solution, the randomized tests may pass or fail from run to run. They should be changed to a cross product (testing all hands against all other hands).