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.
Lua translation!
python new test framework
I found the instructions very confusing.
I'd simplify it by saying that a good char is in the same column or row of buttons as the previous char.
I've got a Rust solution which failed the "num" crate check, since I used the div_floor function from there. Thought only num::BigInt was disallowed. No matter, I removed the dependency, and it still failed the crate check, so I removed all dependencies (itertools) and it still fails the crate check. I reset the environment with the button at the bottom, still fails. I don't know what to do now. Any ideas? I'm guessing the crate is still installed somewhere so the test is failing.
python new test framework is required. updated in this fork
In the PHP version, the random tests will occasionally pop up an empty string instead of a number, combined with an error:
Stacktrace that is supplied with the code goes to the tests, not to the kata-code:
My code handles empty strings as zero, but the tests still fail, as an exception is thrown.
This comment is hidden because it contains spoiler information about the solution
In PHP:
No sample tests
AssertSame
should be usedUsage of class and method is redundant and should be removed
Decimal numbers are used in the kata, which means floats are not the correct data type for this. The returned result should definitely be a string (or a big decimal, but in JS this is complicated).
Rust translation ready for your approval: https://www.codewars.com/kumite/64469a35b8feca00195e995d?sel=64469a35b8feca00195e995d
This comment is hidden because it contains spoiler information about the solution
Adding all kinds of edge cases and different types of input, should be part of the sample tests aswell. This makes the kata less annoying.
Update to JS
Node 14.x
: https://www.codewars.com/kumite/639be9febde94df169ba37cd?sel=639be9febde94df169ba37cdUpdate to
Node 14.x
The kata does not rule out, or properly handle the case where all workers of lowest capability is used, but there are still work left. For example:
Every solution, including author solution, returns
{a: 1, b: 6}
instead of{a: 2}
, which is absurd (there are only 5b
s).Another kind of edge case the kata does not handle is when the greedy algorithm is stuck at lower tier workers, and should fall back to adding a higher tier worker:
Every solution, including author solution, returns either
{a: 1, b: 2}
or{b: 2}
(???) instead of{a: 2}
.For a even more comprehensive edge case test, try this:
(Expected result should be
{a: 2}
)Loading more items...