Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yep, in the tree that is described even in the example, this solution returns the incorrect value "15" instead of "-51".
Fixed
(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.
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.
You may and every feedback is appreciated.
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.
See (starting with 0).
I will see about point 1. Thanks for your feedback.
For anyone reading this in the future - Voile fixed the tests. Thank you!
For anyone reading this in the future - Voile fixed the tests.
For anyone reading this in the future - the tests are fixed.
(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. :)
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.
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.
Thank you! My code passed first time with the fixed tests.
Now to clean up the mess of diagnostics and experiments, and submit it. :)
Thank you for fixing the issue!
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.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).
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.
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...