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.
It does. Print in Python automatically adds a newline at the end by default. But it also works without a newline, because the author calls .splitlines() on the output anyway.
And it's possible without *args because the author, for whatever reason, always calls the function statically with one argument.
Nevermind, I don't know if something changed or if I did something wrong 2 months ago, but it works now. Thanks.
This comment is hidden because it contains spoiler information about the solution
That's because the textbook solution doesn't take into account items of weight 0, which this kata for some reason does.
That's because some items can have a weight of 0 (which is nonsensical), and the solution only checks up to 0 (not inclusive). Change
for w in range(n, 0, -1):
tofor w in range(n, -1, -1):
and it will work.Also
n
can be 0 too. This should be fixed or at least mentioned in the description.It should be mentioned in the description that you may need to include the same zero multiple times in the result. I assume the task was just to find rational zeros, without caring for their multiplicities.
Great kata.
Great kata but the key order thing is annoying. Either include the expected order in the description or use Chai instead of Codewars' test framework.
Fixed state AFT6-CREB-2 -> C being cMyc-2 instead of cMyc-1. Somehow passed the tests in my previous solution.
How can you sort them in place if you need to create new lists?
I think if basic functions like
len()
are disabled, exceptions should be disabled too...Right, I only looked at issues and this was a suggestion.
Tests use == to assert equality so you can return a string.
Then why, in the test case with a set, the expected size of the set is 5?
first yielded value => {}
second yielded value => {0}
third yielded value => {0, 1}
fourth yielded value => {0, 1, 2}
fifth yielded value => {0, 1, 2, 3}
It yields 5 values and closes. Then why is the expected set {0, 1, 2, 3, 4}?
potentiation - the increase in strength of nerve impulses along pathways which have been used previously, either short-term or long-term.
???
Loading more items...