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.
Very interesting. Not sure why your random tests are passing while mine are not. If I am reading my output correctly, my code seems to be returning the correct response while the randomized tests seem to expect an incorrect response. Thanks for checking it out.
Please have a look at this screenshot: http://i.imgur.com/xUvzsUb.png
In every test case the correct answer is
-1
which is what my code is returning. However, the test cases expect a different result.Thanks for replying. Does it sound like I correctly understand what this kata is asking for? If I do, then the random test cases are incorrect and should be checked. If you look at the output that I pasted in - given that the second array is empty - the correct result should be
-1
however, the test is expecting it to be26
.I find the instructions very confusing. After experimenting with your test cases it seems like you are asking the user to find the smallest and largest string lengths in each array. If the smallest length is in the first array, subtract the largest length from the second array and return the absolute value. Otherwise take the largest length from the first array and subtract the smallest length from the second array and, again, return the absolute value.
Is this correct?
Edit:
It seems some of the random tests (in Javascript) are wrong. The instructions say if either arrays are empty it should return
-1
. When I log the arguments provided I see several tests with empty arrays. My code returns-1
in all cases but the tests are expecting a postive numerical result.Example:
The '3 pigs' multiline test has stumped me. My code is returning the modified string correctly with no extra spaces upon each new line, however the test case still says there is an error. It's difficult to debug without more information as to what that error is (ie: an extra space somewhere or perhaps something else which is not detectable with the test case output.)
The best part of this kata was reading the test cases! Probably the best kata on Codewars...
Edit: Oh I see now. 'left in situ' is not a phrase I am familiar with. Thanks for clarifying. :)
I think there is an error with one of the Javascript tests. It is calling an encode() of CODEWARS but also expecting the returned result to be CODEWARS. If you encode CODEWARS, the returned result should be XLWVDZIH according to the provided key.
This comment is hidden because it contains spoiler information about the solution
For anyone having trouble solving this kata when it comes to tests that result in Infinity - you need to find a way to calculate the number of digits that will be in the a^b result, rather than trying to calculate the actual result.
The random tests for Javascript are so large that they return as Infinity so even if one number is larger than the other, Infinity compared to Infinity will always return as equal. Example: [ 3704, 8110 ], [ 8893, 5636 ]
The test case for [1,7], [1,8] in the Javascript kata is wrong. It is expecting 1 when it should expect 0.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thank you! Seems I need to get used to logging all the things! :)
Loading more items...