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.
Well, turns out this kata is now a duplicate of https://www.codewars.com/kata/647d08a2c736e3777c9ae1db (integer partition with an upper limit) with a slight difference (subtracted a specific value from the end result).
Related to the issue below: The author didn't actually write a solution that can pass any input in the given range in time, and in fact, for the current input range the kata is impossible to be solved in time, since the complexity is at least
O(n * w * h)
.The tests are very weak: all random tests have at most
w = 10
, fixed tests go as much asw = 16
, and all tests with biggerw
is always full so a trivial solution exists.I can find 81 with just 3 digits:
It is extremely unclear what the actual specs are from the description.
You should have random tests ( those 12 might be random, but I doubt it .. ), and more than 12. Please see documentation.
You may consider unpublishing while you read the docs, while having insufficient test coverage - it may prevent your kata getting downvoted for it.
Please try to get someone to proofread everything. There are innumerable spelling and grammar errors.
"Vary among languages" is not informative, and you've just reintroduced this issue. Can you stop making these dumb changes which fix/break everything back and forth?
Since when is
-1 >= 0
?This comment is hidden because it contains spoiler information about the solution
The order of the tested values should be randomized.
Input validation is a worthless requirement. Especially, when you're testing only 2 invalid inputs:
-1
and631
.If the user's solution is wrong, the second test will never be executed,
and even if it was, it's completely useless anyway.- well, maybe knowing that the actual digit sum is wrong might help you to some degree, but seeing how the actual result is different from the expected value is still infinitely more useful. If you want to mention this info for some reason, it should only happen in a custom error message.It is possible to easily hardcode everything based on error messages without implementing anything.
Duplicate.
Loading more items...