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.
Ruby:
No fixed tests
function name should use
snake_case
Rust translation
Node 12 should be enabled (Refer this and this for more info)
Python new test framework should be used (Refer this & this for more detail)
Ruby 3.0 should be enabled (Refer this & this for more detail)
From the Example Tests:
I do not understand this. Both arrays have length
5
. So I am to make combinations of length4
. The sum of the elements of those combinations has to be2
resp1
.It would seem I have to answer
1
possible combination in the first case, so[2,0,0,0]
is apparently counted as the same as[0,2,0,0]
.It would seem I have to answer
4
possible permutations (not combinations!) in the second case, because[0,0,0,1]
is apparently counted as different from[0,0,1,0]
.What am I misunderstanding?
Good job on the fixed and random tests, keep up the good work :) However, I'm not sure why you had to limit the length of the input array to just
5
as your Description states that "The combination length will be limited to all combinations which are exactly one less than the length of the array" which made me assume that my solution should be able to handle arrays of any length. I would suggest that you edit the random (and fixed) tests to include assertions that test for input arrays of varying length (and preferably a longer average length than5
). Currently, most (not all) of the random tests simply expect0
as the range of random values entered into each array is too large compared to the actual length of the array.