Ad
  • Default User Avatar

    While I haven't submitted in JS, and I don't know if this is the case, what it looks like is that you are modifying the array in place, rather than making a copy. So the test cases create an array, then run your code on it. Then, in order to check your answer, they run their own doubling code on the same array. If you modified the array at all, then the answer won't be correct.

  • Default User Avatar

    As you've noted, your code is indeed much longer than necessary. You might have noticed as you were typing your code that you have a lot of repeated code. Infact, the code for each different key is exactly the same! While you can still check the input is valid if you so wish, in the main body of the code you could replace your current repeated code with one piece of code, that just refers to key rather than legend ;)
    In future you might note that if you're given a variable as input, and told that it takes its value from a certain set, it's probably NOT a good idea to hardcode those values into your code.

  • Default User Avatar
  • Default User Avatar

    Yeah I'm well aware your solution and a load of others pass the test cases, just a comment that given that it doesn't technically do what the kata asks for, it can't really be considered to be a really clever answer. You're probably right about the test cases, I haven't been involved in authoring kata or the like, so haven't really paid much attention to that.

  • Default User Avatar

    Python description is rather vague. Please at least tell us what our function name should be, or provide Test Cases.

  • Default User Avatar

    This kata made no sense. The solution (in Python) was very simple, but I just had to guess what the kata was asking for as the description/instructions were essentially irrelevent.

  • Default User Avatar
  • Default User Avatar

    In python for the test cases the two arguments of assert_equals are back to front. Ie I was getting the message " '1000' should equal '0b10' " when the message should clearly be the other way round.

  • Default User Avatar

    In Python the description does not match the kata. The description states that we should create a function combineNames, but the testcases require a function combine_names instead.

  • Default User Avatar

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

  • Default User Avatar

    You're entirely right. It was admittedly poor practise on my behalf that was causing my issue :L
    Still an issue though, just a different one to what I thought. Either the description should state not to mutate the original list, or the message when a test fails should be clearer (or both).

  • Default User Avatar

    It's not exactly a problem, but in python the variable inputArray probably ought to be called input_array instead ;)

  • Default User Avatar
    1. Could do with an example test case
    2. Needs more test cases, preferably random ones
    3. I'm pretty sure this is a duplicate of something very similar with a different number instead of 4, but I cba to go check. Either way, needs more tests
  • Default User Avatar

    Nice kata :)
    Took me an embarrassingly long amount of time.

  • Default User Avatar
    1. Lacking example test cases. Could also do with a few more actual test cases, two is not really enough.
    2. Description is incredibly misleading: you're not printing anything at all.
    3. Very very basic and very pointless
  • Loading more items...