Ad
  • Custom User Avatar

    Random tests never generate cases where len(pipe) is less than n. It may lead to solutions like this.

  • Custom User Avatar

    Amazing kata.

    The colors in the description could be changed to black for better visualization in light mode.

  • Custom User Avatar

    Loved this! so much I made a Java translation

    I know this is years old but a fella got to keep him self busy right?

  • Custom User Avatar

    actualy, [(1), 1], [1, (1)] must return True, cause [(1), 1], [1, (1)] same to [1, 1], [1, 1] and its the same structure. But yeah, i get the point ([(1,), 1], [1, (1,)]), just little detail...

  • Custom User Avatar

    U,D,L,R = cockroaches with initial directions facing UP, DOWN, LEFT, RIGHT

    initial direction

    When they hit a wall they always turn LEFT and then they follow the wall until they can find a hole to crawl into!

  • Custom User Avatar

    Yes, first it goes down until the wall, then follows it and the first hole it meets is 1 (it would need to continue upward to see the 2). The letter only tells you the direction it follows until hitting a wall.

  • Custom User Avatar

    From the first picture, the cockroach goes down to the bottom wall, then left (from cockroach's perspective, but right from birds eye view) across the bottom wall, then up the right wall and into hole 2. I wouldn't have drawn the second picture, because I didn't think of the D cockroach as turning into a U cockroach. Rather, my D cockroach was just sometimes in a "move left along wall until hole" phase.

  • Custom User Avatar

    in which of the two holes should go a cockroach in this case?

    
    +----1+
    |D    2
    |     |
    +-----+
       ↓
    +----1+
    |    U2
    |     |
    +-----+
    
  • Custom User Avatar

    Teaches assertions in regular expressions. Must be approved. Nice kata

  • Custom User Avatar
  • Custom User Avatar

    The solution is wrong. It find position of braces and use weakness of testing. Mistaken for simple examples: [1, '['], ['[', 1] you program returns False, or [(1), 1], [1, (1)] returns True

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    you actually change input matrix, so test case change itself. If you don't want to change the code you must find the way to copy all contain of the matrix(may be tricky)

  • Loading more items...