Ad
  • Custom User Avatar

    From the description:

    The function must accept a non-negative integer. If it is zero, it just returns "now". Otherwise, the duration is expressed as a combination of years, days, hours, minutes and seconds.
    

    Centuries are not mentioned. You can be reasonably sure that "years" is the largest category.

  • Custom User Avatar

    Descriptions should endicate what is the the highest expression of time , either hours, days, months, years and maybe centuaries who knows ?

    Adding unclear descriptions doesn't make a problem to be a 4Kyu !

  • Custom User Avatar

    Yeah, I realised this afterwards, and one small change fixed it. Oops!

  • Custom User Avatar

    The input that you're getting 10 hours on is 3662 seconds. 3662 seconds is not 10 hours. Also, you cannot "lose" kyu by failing to complete a kata.

  • Custom User Avatar

    C++ test is WRONG!!! Should be 10hrs but says 1hr!!! I LOST KYU FROM THIS KATA >:(

  • Custom User Avatar

    I agree. Should be 7 or 6 kyu imo.

  • Custom User Avatar

    I replied to your other post; the expected results are entirely correct. Shapes can have holes in them, and those holes are meant to be empty when you return just the shape.

    Think of them as the space between their boundary lines, where the boundary line can be the outside (like a simple square) but also on the inside of the shape (forming a torus or donut or ring).

  • Custom User Avatar

    I think you misunderstood what should be returned. The expected result is entirely correct.

    The last shape is a single undivided shape, no window; the inner square is a hole in the shape, not a structural part of it:

    +---------+
    |         |
    |  +---+  |
    |  |   |  |
    |  |   |  |
    |  |   |  |
    |  +---+  |
    |         |
    +---------+
    

    Here is the same shape with whitespace that is not part of the shape replaced by . dots:

    +---------+
    |         |
    |  +---+  |
    |  |...|  |
    |  |...|  |
    |  |...|  |
    |  +---+  |
    |         |
    +---------+
    

    The shape consists of just the squarish donut with a hole in the middle. The shape you thought you should return is not a single shape; here it is again:

    +---------+
    |         |
    |  +---+  |
    |  |   |  |
    |  +---+  |
    |  |   |  |
    |  +---+  |
    |         |
    +---------+
    

    Notice that line in the middle? That's not part of the outer shape, that's the dividing line between two smaller shapes that fit inside the hole there. Here is your shape with green dots marking the shape you were supposed to extract, and red and yellow x-es for the two shapes you incorrectly included:

    +---------+
    |.........|
    |..+---+..|
    |..|xxx|..|
    |..+---+..|
    |..|xxx|..|
    |..+---+..|
    |.........|
    +---------+
    

    You need to return those two inner shapes separately (which you did, together with the 3rd hole from the other larger A-shaped piece).

  • Custom User Avatar

    I've created a Rust translation, please review and approve!

  • Custom User Avatar

    Then it is not as straightforward as you mention. Only 1/3 of it was ;)

  • Custom User Avatar
  • Custom User Avatar

    The Python tests have long since been updated (including random tests).

  • Custom User Avatar

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

  • Custom User Avatar

    I'm having an issue with this Kata. The errors I'm getting are about mismatch between the expected and actual results in the tests, specifically those where the shape has shapes within shapes. And from what I can see, the expected solution is not correct.

    Can someone have a look at the expected results? If you look at the input shape, you can see that the expected sub shapes do not have the same inner shapes that they should have.

  • Custom User Avatar

    Thank you Chrono79! So, as I said in the first post:

    The expected result doesn't seem to be correct. The final sub shape should look like a window, with two small squares inside a rectangle, but instead it expects a long thin rectangle inside of another. If you look at the source shape, my solution outputs the correct result.

  • Loading more items...