Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 be 26.

  • Custom User Avatar

    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:

    [ 'ttffdddooo',
    'bbbtttthhhnnnny',
    'hhkkkww',
    'jlllh',
    'jjccccaaaazzzztttqqqwwqqqq' ] []
    It should work for random tests too - Expected: 26, instead got: -1```
    
    In the above copy/paste, the answer should be `-1` since the second array provided is empty, yet the test is expecting the answer to be `26`.
    
  • Custom User Avatar

    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.)

  • Custom User Avatar

    The best part of this kata was reading the test cases! Probably the best kata on Codewars...

  • Custom User Avatar

    Edit: Oh I see now. 'left in situ' is not a phrase I am familiar with. Thanks for clarifying. :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 ]

  • Custom User Avatar

    The test case for [1,7], [1,8] in the Javascript kata is wrong. It is expecting 1 when it should expect 0.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thank you! Seems I need to get used to logging all the things! :)

  • Loading more items...