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.
I know this kata is not so seasonal 😅, but I hope you all like it.
Thanks for pointing it out, fixed it.
The description states that only
Me
can have gifts greater than 9 but makes no mention ofMe
having negative gifts, and random tests whereMe
has negative gifts do not expect 0.Indeed, I tried other naive solutions but missed the most obvious of all - using set operations. Looks like I need to increase the amount of tests.
As well as mine, which is essentially the same
I feel like this wasn't the intended solution.
Looks good, approved :)
Agreed. 8 x 8 was generating some run times that were exponentially more difficult. I've pushed all the random tests up to
100
runs, and that's gotten it to a more uniform average run-time of3.5
seconds here.Great to hear, thanks :)
And Ive run the new test cases a few times and the time variance seems quite high.
Maybe we should add some smaller grids than 8 instead, to make the time it takes more uniform.
OK, I've added the fixed tests to the full test suite and added
8
to each of the dimensions of the random rectangle tests which got my average run time up to about 5s.The algorithm is exactly the same as the Python solution, so I'm unsure where the discrepancy in performance comes from.
I don't think I'd push it any further than that seeing as one randomly generated Garden of Eden ( although rare ) significantly increases the search space and risks time-out for otherwise good solutions. Have a look.
BTW, this was one of the most challenging, rewarding problems I've ever tackled. Thanks for such a great kata!
Looks nice already, although I dont know much about js. A few things:
Javascript translation
Review carefuly; it's my first translation.
The preloaded solution for this kata contains a function named "two_oldest_ages(ages)" which doesn't match the kata's description. This kata's details section should be written in English, which is the Codewars standard.
Annulla la pubblicazione e leggi questo:
https://docs.codewars.com/authoring
This comment is hidden because it contains spoiler information about the solution
Loading more items...