Ad
  • Default User Avatar

    Yep, in the tree that is described even in the example, this solution returns the incorrect value "15" instead of "-51".

  • Custom User Avatar

    Fixed

  • Default User Avatar

    (C#) Please update test cases, or tell me how I can.
    They report user code results as "Expected" and the correct answer as "Actual". I believe this contributes to some of the "spam" issues from people misunderstanding.

    Assert.AreEqual(PyramidSlideDown.LongestSlideDown(smallPyramid), 23);
    should be:
    Assert.AreEqual(23, PyramidSlideDown.LongestSlideDown(smallPyramid));

    etc.

  • Default User Avatar

    Thank you very much!
    Your explanation about pure functional programming is helpful. The whole Kata makes a little more sense in that light.

    I read the description and it looks great.

  • Custom User Avatar

    May I suggest a couple areas where the explanation could be clearer?

    You may and every feedback is appreciated.

    1. I was confused by the expectation in the tests that after reading (e.g. Take or Drop n items) from a stream, doing that again should return the exact same data.

    In pure functional programming all data is immutable. Accessing references can't change them. I will think about some way to mention that in other languages.

    1. I looked up Fibonacci numbers and turns out it is up to you to define if you want to start with 0 1, or with 1 1. I guessed wrong. :) Not a big deal, but a quick fix also.

    See (starting with 0).

    I will see about point 1. Thanks for your feedback.

  • Default User Avatar

    For anyone reading this in the future - Voile fixed the tests. Thank you!

  • Default User Avatar

    For anyone reading this in the future - Voile fixed the tests.

  • Default User Avatar

    For anyone reading this in the future - the tests are fixed.

  • Default User Avatar

    (C#) Wonderful kata. I like the ways it made me have to think.

    May I suggest a couple areas where the explanation could be clearer? They were not difficult to overcome thanks to the extensive tests, but learning "specifications" from the tests is less than ideal. :)

    1. I was confused by the expectation in the tests that after reading (e.g. Take or Drop n items) from a stream, doing that again should return the exact same data. My assumption (and implementation) was that after I read a line from a file stream, etc. I would keep reading at the point where I left off i.e. forward-only, don't consume memory with what I've already read, etc.
      I'm not saying everybody will have that assumption, but I don't think it is extraordinary.

    2. I looked up Fibonacci numbers and turns out it is up to you to define if you want to start with 0 1, or with 1 1. I guessed wrong. :) Not a big deal, but a quick fix also.

    Thank you again for an extensive and well thought out Kata.

  • Default User Avatar

    Thank you! My code passed first time with the fixed tests.

    Now to clean up the mess of diagnostics and experiments, and submit it. :)

  • Custom User Avatar

    Thank you for fixing the issue!

  • Custom User Avatar

    Okay, I fixed the C# version. There was something wrong with the test generation, the reference solutions are all valid.


    It's getting increasingly close to CodeWars Fun: Arrogance, and no, nobody wants to play that.

  • Default User Avatar

    Just explain how Decode("iK8ZHB[hY", 6) should produce "[[[[[[[[[".

    Because I am passing tests by hardcoding such nonsense. There's no way it could round-trip.

    @Voile: Both your code and the Kata test code is incorrect if the above is how your code decodes (and it must have done so to pass the tests).

  • Default User Avatar

    And there's a 5kyu kata that is actually more complex:
    "All that is open must be closed"
    https://www.codewars.com/kata/55679d644c58e2df2a00009c

    It requires handling an arbitrary set of "braces" passed in as input, handling some where open and close are identical (like quotes). And the input can contain non-braces.

  • Default User Avatar

    How come the test case passes in an impossible to decode string?
    I suspect a clever algorithm is being used to solve these, but it doesn't choke on this special case...

  • Loading more items...