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.
LC translation
Added more edge test cases by your suggestions, now this solution will be guaranteed to fail each time.
using namespace std;is OK in test snippets. It is not OK, for Codewars specific reasons, in preloaded and in solution snippets.problems:
rand()(should use stuff from<random>instead)using namespace std;(Codewars docs strongly advise against this)This comment is hidden because it contains spoiler information about the solution
Enabled in this fork
This comment is hidden because it contains spoiler information about the solution
My preference is some biased and ( always ) some unbiased. With biased values, there's always the possibility you miss something in the biasing.
Yes, this depends on people reporting edge cases for their particular solution that come out of any random test. Not everybody will, but people have been known to do that.
My way in Haskell ( includes shrinking; the built-ins now just work ).
I think perhaps we could generate 100 random tests the current way, and 100 your way.
Would random generation be better if we didn't generate fully random numbers and random powers of 2, but random
m,ns forx = 2^m * (2n + 1), maybe with a higher probability ofn = 0? I think that would distribute generated values more evenly across the rows and columns of the grid.fixed for Haskell. I approximated the odds as used in JS for simplicity, and bumped up the number of tests to 200 to make even more sure every scenario will be tested.
@JohanWiltink Haskell should also generate some random cases with x = pow2 -> (x, x)
fixed for JS & Python
Not fixed tests plural, in different categories ( ie lines in the example ). There's something to be said for more extensive fixed edge case tests.
17definitely equals17though. :PETA: wrote this before I saw the previous comment
Loading more items...