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.
Rejected by someone (?
@ hobovsky ~ Thank you. I originally had created an array of integers for tests with exactly 10% zeroed out, but I thought that to be too complicated at the time. However, I will now keep this principle in mind.
Just a remark: if you generate edge cases based on random chance, it's still possible that you won't generate any, right? Especially when there is many special scenarios but you want to generate only a few instances of each. Much better would be to generate, for example, 90 "normal" cases, 5 edge cases of one kind, 5 of another, and shuffle them. This way you always know that solution is guaranteed to encounter special case of every kind.
(rand() % 1000) < 100
more accurately acheives a 10% occurence ofa==b
, although agreed, it is not critical (nor the 50/50 split which just felt balanced).Hi mouloud, these two updates have now been done. Also, I put in the new description; hope that looks okay to you.
I forked it -- try to approve that
'alr approved some time ago'
Nice catch, thanks. Looks like I'm getting senile :-) Fixed
Something still wrong with the translation?
The description should be OK (it's the same as the current, so it will not change that).
And yes, I suggest to add the edge case to python and update the random tests too.
Cheers
Updated the translation and added an edge case:
Test.assert_equals(sharkovsky(17, 17), false)
Also updated the random test generator so that in 10% of the cases
a = b
When I did the translation,
a == b
was not tested. If it is now, then this edge case should be tested at least in the fixed tests. I will update the translation.Then I may need to rewrite the solution, because I didn't use the most straightforward options ;-)
.
Loading more items...