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 try again, this time with the new fork?
cheers :)
I specified the inputs in the 'input' section. It took me a few minutes to find Optional Section Formatting in the wiki.
@mattlub Let me know if you'd prefer something different.
It's impossible to work with arrays in C without additionally passing their length to the function. Specifying that the user will receive it is superfluous.
No, I'm afraid not. In C arrays of varying length are passed by a pointer to the first element and additionally the number of elements.
Should I add a C-specific section to the description?
in C, you can't get the real length of an array very easily, so on C katas you include the length of the array.
You're right sorry. Code updated. You may want to add a static test to the Javascript for ['rainy'] becuase my Javascript version passed :-)
@mattlub:
I've tested your case with both my working python and java solutions.
The result for that customers array and n=7 equals 113.
I've even added this test case of yours to the test suite.
I want to mention also the fact that I've already put in place a random test cases generation (although a bit ugly to see, but widely tested).
Hopefully this helps.
Hi
mattlub
,this code fills the list
tills
with the0
repeatedn
times.Should be fine now I think ;)
This comment is hidden because it contains spoiler information about the solution
Nvm, actually you are right, it should return {50: 1, 20: 0, 1: 11}, just woke up(slow brain :P). Ill rephrase it again, it should use the higher levels always if the remainder is still solvable with the remaining levels so it should take the 50 and ignore the 20
Yes there are, and in this case taking 50 would result in it not being solvable even though it is, so its not possible to take that level. So thats what I meant by as high levels as possible. So here you would skip 50 and use 20 3 times resulting :
{50: 0, 20: 3, 1: 0}
. I will try to make it clearer ;).