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.
True, but the way it is written it says "...that the customer need to pay how much money". Customer, singular, not customers, plural. That's a key difference, and changes what the answer should be. Most definitely a language issue, and not a big deal, but perhaps may be worth a rephrasing for the future.
For JavaScript, it would appear that the tests are written with the "Expected" and "Actual" values swapped; verified by coding my method to always return the value -1, and every test failed by saying: "Expected '-1'".
For me, the graphics showing how the letters are assigned isn't loading in the description any longer. It looks like the markdown code is not formatted properly. I was able to use the imgur links in a browser separately to view them, though.
This comment is hidden because it contains spoiler information about the solution
Despite the kata details clearly stating that 1 <= subtrahend <= minuend, under the Javascript tests suite it appears that the random tests do not prevent the subtrahend from being greater than the minuend. I could not get my solution to pass the random tests because quite often I'd see something like "Testing a = 546, b = 578", which I imagine is saying the subtrahend (578) exceeds the minuend (546). Since my script was attempting to reference an array entry that did not exist, it was throwing exceptions in the JS engine. When I essentially "regrouped"/"borrowed" from a non-existent value, the tests pass.
I believe the random JS tests should be examined to ensure that this situation cannot happen, or conversely the kata specification needs to indicate that negative answers are indeed possible.
This comment is hidden because it contains spoiler information about the solution
I believe the TypeScript test cases are also wrong. I've run a few times and consistently found the random tests are looking for the solution to be a "less" value than my algorithm found.
Examples:
20313: expected [ 1, 2, 3, 4, 5, 13, 201, 20312 ] to deeply equal [ 4, 8, 12, 201, 20312 ] (yet my 13 value is > solution's 12 value)
2204: expected [ 1, 3, 4, 5, 66, 2203 ] to deeply equal [ 2, 3, 13, 65, 2203 ] (yet my 66 value is > solution's 65 value)
This comment is hidden because it contains spoiler information about the solution
Strange result for me in TypeScript. My solution passed the final tests and I submitted to get a passing result on the kata, but could not get the solution to work on the sample test. For the first sample test, I got this note:
Fail: expected [ 20, 12, 18, 30, 21 ] to equal [ 20, 12, 18, 30, 21 ]
For the life of me, cannot figure out what's going on with the chai test, and why it wouldn't recognize the two arrays as equal to give me passing credit on the sample test. Odd.
There appear to be a small handful of coding issues in the test cases for TypeScript:
Extra quote after the semicolon:
...
All should be assert.equal, not .equals:
Once those are corrected, the test cases run nicely. Excellent kata, btw.
Thanks!
It's not just the fact that there's no mention of case sensitivity. It's that the kata description clearly says that all inputs will be lower case letters:
The input string will only consist of lower case letters and/or spaces.
The first test case (actually, the sample one as well) has an upper case letter which must be counted.
IMHO, the kata description needs to be rewritten. Sure, a quick glance at the sample case shows what's going on, but to be neat and proper it should mention that in the description.