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.
I see some wrong answers (checking only for SUMS), I guess the tests doesn't cover an example with duplicates but the same sum?
I would replace the -1 result with a null/undefined/false, -1 index it's a Java relic limitation that should not exists in the first place. It is more confusing in JS because you can do string.slice(-1).
Nice one really, all the basic algorithms should have at least 1 kata around here.
This comment is hidden because it contains spoiler information about the solution
Do you mean DIGITS not numbers, please update the description because the results are very different.
Why ppl think english is the only language in the universe? Nice kata but the "th, st..." shouldn't exists in the algorithm, just my 2nd cent.
This are the input and output of one of the failing tests
This comment is hidden because it contains spoiler information about the solution
I think an input has a misspell in the unit tests (2100k instead of 2100).
Description:
filter2('2100') == '2KB';
TestCases:
Test.assertEquals(filter2('2100k'), '2100k');
Error:
Expected: 2100k, instead got: 2KB
Anyway you do not understand the principle, the message "Input argument must be a string" is wrong, the description of a test should be what you compare in the test (result should have been x, but is y given z as input). That message is related with the implementation and scenario, is not communicating nothing usefull to the programmer.
This is how should be:
Instead this kata returns
Message is wrong, 19 tests passes, inclusive all the tests from category "Incorrect string type".
The error is from the 3rd test from category "Asserting equals:".
I think something is wrong in a description of a random JS test, I keep getting
TypeError: Cannot read property '0' of undefined at battleTest at Object.Test.describe
Can you check it out please?Overall the kata answer is not solving the problem, is to assert the input, I do not like it. Though I want to finish it.
Unit test messages should state what input was given and what should be the answer, otherwise is guessing from my side.
I still have the error "Input argument must be a string" at the last test (in JS) though I have "typeof==string", so it is a string, the message is wrong.
I think the JS error messages are confusing, "Input argument is a string." what does it mean? What was the input, what was the expected output?
It has errors or has wrong test cases messages.
I think the random tests are not realistic, a country cannot win more then (byte) medals in a single olympic event. I think there are 300 maximum if they win all of them?