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.
could you please tell what pattern, I have to search
Check boroda_29's post below.
what version of Python did you run it with in your environment?
what version of Python did you run it with on Codewars?
There are almost always closed form solutions for sums of numbers.
Never mind. I didn´t put the name of those algorithms. There is a very important tool for a programmer when integer sequences are involved.
www.oeis.org
Remember that Brute force algorithms can´t solve all the challenges and as I wrote below, "Try to study a math pattern in the triangle to speed up your code."
There are 2 things you can look into. Currying which allows you to pass in multiple seperate args, however due to this problem giving an unknown number of args, maybe try solving it using classes instead.
Python - I think one of the randome test still have the actual and expected value mixed up in the assert. There is always one random test that says my expected value is incorrect, so I run my code in an ide with the failed input and it returns the proper value.
This comment is hidden because it contains spoiler information about the solution
ZZzzzz
:-)
HAHA! Second french guy I cross path with, on codewars! ;)
About your code, you've got a misspelling error in the definition of
spin2
:spins[i]
, notspin[i]
. CW didn't raise an error because the variablespin
is defined in the tests cases, so you didn't use the argument of your function but a variable in a larger scope. With that, all will be good. ;)Happy coding on CW!
.
Could you paste the full code you are using ? (yeah, still not in bed... :-/ Thanks to Dinglemouse and his "Soundex"... ;) )
Note: which part of Europe or Africa ? (personnaly: bread, wine, beret and Eiffel Tower... ;) )
The point of enumerate was to write:
spin2 = [reel[spin[i]] for i,reel in enumerate(reels)]
It's more verbose, so the code is easier to follow. But it's more verbose... And effectively, your modification makes sens too, with therange(3)
.About the "new info", considering that many guys did pass the kata without problems, could you have read the log of the following or previous test, actually ?
EDIT : Hu... I forgot the way the random tests are dsplayed... I'll take a look, but I'm really tired, right now (it's midnight on my side of the world... ;) )
EDIT²: checked. Your algorithm is good. It should pass the tests (it did on my side!) If it's not the case, check the modifications you did that you didn't talk about in your previous message: your problem lays there, right now.
I'm going to bed, cheers!
Ok. Think about what could be
spin2
whenset(spin2)
gives you something like{'Wild', 'Queen'}
...Loading more items...