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.
Not an issue
This comment is hidden because it contains spoiler information about the solution
Check it now and let me know. I don't know what I was thinking about one year ago. :)
I'll fix it as soon as possible. Thanks @bouchert for the observation. Thanks @kazk for your answer.
I didn't realize this when approving. I agree this is an issue and would like to resolve this.
I'm able to edit this kata, but the test looks super confusing. I don't know the purpose of the following:
Also, if this shadowing of
permutations
is not done on purpose (to disable second parameter), I don't know why it's there.I can't think of any explanation for
combinations
.Am I missing something? (I don't know how Python's modules work.)
Maybe we need to wait for @raulbc777.
It's not entirely clear what your problem is, since you don't say anything about what errors or problems you're experiencing. However, it's possible you're running into the subject of my complaint above. You can't do
from itertools import permutations
for now. The test declares its own, less flexible version of permutations that overrides it, and which doesn't accept a second parameter. For now, you can work around it by callingimport itertools
and then using the fully-qualifieditertools.permutations
function.For the Python test cases, your decision to define a function named permutations that only takes one argument causes a conflict with anyone who does a
from itertools import permutations
and then makes the otherwise entirely valid function callpermutations(a,k)
return a confusing error about permutations only expecting one parameter. Even though you could just alter your implementation of permutations to accept an additional argument, generally speaking, you should try to avoid collisions with importable functions and user solutions' choices for their variable names. Please try to use as few global variables and functions as possible, and use long, uniquely non-obvious names and/or store them inside of a single variable or class.It's up to 9 digits, so your code is too slow to pass the final testcases;-)...
This comment is hidden because it contains spoiler information about the solution
It was already translated by suic, regrettably Y_Y
At the moment CW is very slow.
Approved. Where is your
Python
? ;-)OK, thanks for your feedback ;-)
Well, I was wrong. There can't be two solutions.
Sum of combinations may be equal to the elements in the shuffled array but it's not necessarily the left out element. I have now completed the Kata too.
Thanks! It was really fun.
Ruby and Crystal solutions dished. Tschuss!
Can you make a concrete example? As I don't see any chance of getting two different numbers as viable solutions, but I might be short-sighted.
Loading more items...