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.
Nothing unresolved remaining.
Really interesting Kata :-) I'm not really sure whether my solution is actually completely correct, since it would break when a shape is allowed to have holes in it, so that it would have to return such a shape, instead of two rectangles.
This comment is hidden because it contains spoiler information about the solution
Please fix the setup of the Kata. Regardless of what you type, it will not compile, unless you actually put in include guards and other stuff. If that is indeed what is expected, it should be clearly stated in the Kata description.
I sincerely hope that no one will ever try to come up with this kind of code in actual real world C++ code. If I'd ever be presented with that in a code review, I'd fire the person who did it...
Apart from that: nice lesson about the really dark corners of pointer arithmetics. There's reasons why most programming languages stay clear of that stuff.
Great Kata, spent quite a while sitting down with pen and paper to figure out how the numbers and digits line up. The actual programming was not that much of a challenge.
This comment is hidden because it contains spoiler information about the solution
Just a small suggestion for the C++ version of the Kata: Maybe change the signature from using long to something like uint64_t. There are compilers out there that treat a long as a 32bit variable, and that is too small for this Kata.
Yeah, I figured out a different approach now, doing a deep dive into long forgotten maths classes from university. So just for clarification, from your comment I would understand that each test case has its own timeout of 12 secs - otherwise, why would I be able to tell that the last test is the one to cause the problem? Maybe one of the earlier test cases takes 10 secs and the others after that are not actually the issue? But that has nothing to do with the problem at hand, just a general observation/question.
I'm a bit confused about the timeout in the C++ version. On my own machine, a debug build has no problems running even the big number tests in less than 5secs. Still, when attempting to solve the Kata, it times out. I'd actually be interested how much time the tests actually take, to figure out which input actually causes the problem - would it be possible to add something like that to the output?. Also, is the compile time also part of the time limit?
As others have stated, the C++ interface is C, so the completely wrong language. What's more: description of the input data format is lacking a decent example, as is the description of the output. The different instructions are basically only understandable if one has solved a brainfuck interpreter kata before. For anyone else it's just guesswork - and it does not help that the description just copies verbatim from the Boolfuck webpage. So, after solving the other Esolang katas, this one was a huge disappointment.
The actual implementation work (once I figured out what the input and output data formats are supposed to work like) was not even that complicated, definitely not a 3kyu.
This comment is hidden because it contains spoiler information about the solution
The random tests for C++ seem to be broken in a major way, as they do not seem to be taking precision issues into account at all. I tried solving it by converting the input to double and then calculating everything using doubles - works for the public tests, the random tests fail randomly. I also tried solving it by converting intermediate results back to string, that seems to be nearer to the results which are expected, but will still fail randomly. That's too bad, since it's actually quite an interesting kata.