Ad
  • Default User Avatar

    By using so many languages, it's not a surprise you can't remember syntax and libraries. It may be better to master a language and then change to another one, instead of "using" lots of languages without even knowing/remembering the basics.

    It would be the same, if a person claims to speak 5 languages, but then needs a dictionary to ask a simple question. Sometimes, less is more...

  • Custom User Avatar

    kata's Sensei @raulbc777 should add another example (with an even number of columns),
    or change the description to emphasise what's expected.
    Many assumed an alternating sum would work. (so did I at first, until I went with
    actually implementing the equation)

  • Custom User Avatar

    At that point you've pretty much taught yourself it. I'd say that would be fine.

  • Custom User Avatar

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

  • Default User Avatar

    So to answer @warkentien2's question, is it considered appropriate to use stackoverflow or google to help solve katas? IE, I don't copy and paste the solution from somewhere else, but I use the web to find methods, check syntax, check libraries, etc.

  • Custom User Avatar

    Thanks,

    I'm pretty sure it's been there all along, but it's easy to get into a mode where you skim over the text of the error and just read the results, especially in this case where the error looks the same as the ones you were getting but the context is suddenly different.
    From the upvotes, it looks like you're not the only one who encountered the problem.

    I'm sure there's a user experience lesson in there somewhere.

  • Custom User Avatar

    I hope "The original array should not be modified." was added later. Or I just missed it!
    Great kata!

  • Custom User Avatar

    See also pioraid's answer to the question above for more infomation.

    If anyone can find a good description URL I can put that in the error message too.

  • Custom User Avatar

    This is a test of changes to the INPUT array rather than the output result as in all the other tests.
    I've added some more text to the test failure message which hopefully makes this clearer.

  • Custom User Avatar

    Javascript last non-random test:
    says [1,null,1,2,null,2,null] should stay as it is.
    instead of [1,1,1,2,2,2,null] like in other tests.
    example:
    Random input: [3,null,null,4,3,null,3,4,null,null,2,2,null,null,null]
    Test Passed: Value == [3,null,null,4,3,3,3,4,null,null,2,2,null,null,null] // note that input[5] changes

    Seems like an error

  • Custom User Avatar

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

  • Custom User Avatar

    @ecolban @g964
    JavaScript: my algorithm takes too long.
    worked up to test 8, but went over runtime for 7654320.

    I'll need a raincheck on that number theory if you would be so kind

  • Custom User Avatar

    @idjaw the round() did the trick! thanks!

  • Custom User Avatar

    good point about number of solutions + making past Beta. I'll keep that in mind.

  • Custom User Avatar

    Randomized tests can prevent this kind of cheating. If there was no other way to solve a kata but to hardcode the tests, by the time of 180+ solutions accumulated this discussion would be full of issue reports, not to say this kata would never leave beta. Besides, I skimmed through the solutions before my answer to you, as well as solved this kata myself, and also translated this into a couple of languages, so I really knew this kata is solvable and the description is valid.

  • Loading more items...