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.
Seemed obvious at first. Not so. Pretty good.
Is this really a 5?
Never mind. It was a bug in my code. It all works now. Very challenging kata. Excellent
I have a fast solution that works on all tests except the randomized test. Can you confirm all tests are valid? Thanks
I figured it out. It passes now. The funny thing is that the correct solution was one of the first I thought of, but because it ran out of time, I assumed it was wrong. Then with some simplification it all worked out. Good kata.
I am a bit stuck on this one. I have an algorithm whose complexity I estimate to be O(N*log2N) where N is the number of pixels.
Everything works except the big test which I can't get to run below 7 sec. or so. Obviously I am missing something because I can't
seem to be able to see the 2-pass solution.
According to the description the object of interest is a large block of contiguous pixels all of the same colour. I took it to mean 'exactly one block'. In reality, the random tests contain cases where the given color is distributed over several contiguous areas. Either way is fine, but I thing the description should reflect that and some of the non-random tests should exercise that situation.
The elevator problem was one of my first school projects in CS. Seems easy at first but it's non-trivial. Good kata.
After a few attempts I managed to come up with a simple solution. It's like a piston. Up and down, up and down.
But where do you stop, that's the question.
Yes, I am working on the challenge version now.
My point is that many authors make assumptions that are obvious to them but not necessaritly to all readers. Sometimes the difference between solving a puzzle or not, depends on whether you think like the author or not, rather than your understanding of algorithms and math. I guess thinking out of one's own box is part of the challenge.
Indeed a lot of simple algorithmic problems like this one will not scale unless you can somehow 'reuse' partial results. But with this one it's not obvious how.
I applied some additional optimizations and enventually it succeeded, but I still think that the testing overhead is too much.
This comment is hidden because it contains spoiler information about the solution
May I suggest you specify that the rotation is around the Z axis? Meaning, if you look at the paper, the Z axis is the axis that goes from your eyes to the paper.
If so, then 1691 becomes 1691, fine. But if you rotate by 180 degrees on the X axis (your right) it will become 1961. See my point?
I guess 3 is not reversible? I thought it was
Loading more items...