Ad
  • Default User Avatar

    Seemed obvious at first. Not so. Pretty good.

  • Default User Avatar

    Is this really a 5?

  • Default User Avatar

    Never mind. It was a bug in my code. It all works now. Very challenging kata. Excellent

  • Default User Avatar

    I have a fast solution that works on all tests except the randomized test. Can you confirm all tests are valid? Thanks

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    Yes, I am working on the challenge version now.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    I applied some additional optimizations and enventually it succeeded, but I still think that the testing overhead is too much.

  • Default User Avatar

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

  • Default User Avatar

    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?

  • Default User Avatar

    I guess 3 is not reversible? I thought it was

  • Loading more items...