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.
The problems here is to avoid loops by finding a formula (or more) that can get the job done quickly. I managed to find a crappy solution but still with one loop (hovewer I saw some solutions with zero loops at all). By typing the inputs of the kata on oeis.org it will return different algorythm with all kind of details. By looking at all this informations and (tinkering a lot) you may find some insight to solves this kata. (Also, leaving the keyborg and using some pencil and paper help me a lot for the tinkering part.)
This comment is hidden because it contains spoiler information about the solution
I run python 3.6.1 and I didn't noticed I could change the python's version on codewars. So I changed it to 3.6 and now my code works.
Thanks @rowcased for the input.
On my side, my code work fine for all the attempts: I get the (categorie : number) in the given categories order. But when I tried on codewars, the ouput is randomized. Weird.
I finally found a solution (one fking year later). Thanks for the oeis.org link it help and I think it will definitely help even more in the future.
Well I didn't though that my solution could be qualified as 'brute force' ...
You are telling me that a math pattern will allow me to avoid the double loop ?
I found that one condition (check if superior to 0) was unnecessary. Still too long to process ...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I didn't understand this, thanks.
I'm a bit lost with this new information. The first sample suggest otherwise :
There isn't any fox in the first pack but in the end all the chicken are gone.
Oh My Glob ! That was so obvious.
Thank a lot for your suppor and happy baguette :)
This comment is hidden because it contains spoiler information about the solution
I am aware of the many guy who pass without problems (27 with python) BUT maybe my solution is kind of original ... (probably not the most efficient)
I think the
spin2
is always wrong with the random test but somehow I can pass some of them (probably luck). But, I'm repeating myself, I've errors in Codewars but not in PyCharm.And I think we are on the same side of the world (It's also midnight for me ;))
This comment is hidden because it contains spoiler information about the solution
Loading more items...