Ad
  • Custom User Avatar

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

  • Custom User Avatar

    This happens only if arr contains 1 element. In that case you should just return 0 at the beginning of the program.

  • Custom User Avatar

    Re-checked and re-published twice to make sure :)

  • Custom User Avatar

    When I press "Run Examples" for C#, I still see following:
    error CS0117: Tree.TreeNode' does not contain a definition for MaxSum'
    Please check

  • Custom User Avatar

    Edit: deleted the previous example as I probably made a copy/paste mistake. Turned out I was failing on the exact same array as chris_w, so I guess RandomTests aren't that random.

    Edit2: I just managed to pass this kata by just taking the middle value as median and no longer accounting for even length arrays, so the problem is that they're still part of the test suite.

  • Custom User Avatar

    Could you please elabore, Ivsz? The spec requires the data set to be of an odd length. However, even though I've fixed the tests (they now only generate data sets of odd length as required by the spec), I did implement even-length data set support and tested it. Do you still have illegal tests generated for you? Thank you.

  • Custom User Avatar

    Do you have to wait for the changes to take effect? I'm still experiencing the same problem, even though I also get mean: -1.242775, median: -3.000000, largest = mean using the above array as input.

  • Custom User Avatar

    I've located the bug and fixed it. Thank you for your contribution, Chris!

    If you are interested in the nature of the bug causing the issue:
    Kata spec requires the data set cardinality (length) to be an odd number. In my tests, however, I failed to convert the randomly generated data set size to an odd value. Thus, the solution function, which was not built to accommodate even values, had a data set of even cardinality passed to it, thus causing problems.

  • Custom User Avatar

    Hey, Chris, thanks for reporting the issue! I'm looking into it.

  • Custom User Avatar

    Indeed. fixed!

  • Custom User Avatar

    I'll edit, solved a few and didn't notice.

    By the way, is there a way for you to enforce it?

  • Custom User Avatar

    If you "unlock solutions" for a kata in another language you can then create a translation in the desired language without having to solve it.

  • Custom User Avatar

    Excellent. Thanks. Kind of an odd problem, especially with it hidden away like that.

  • Custom User Avatar

    I tried the C# version of this, and I'm repeatedly getting an exception thrown with every one of the calls saying that the key is not found. I copied my code into Visual Studio with the dictionary being a private variable in my test class, and it ran perfectly.

    I have a feeling there's a disconnect and that dictionary needs to be made static on a class so we're able to access it from our test code.

  • Custom User Avatar
  • Loading more items...