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.
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?
actualy,
[(1), 1], [1, (1)]
must returnTrue
, 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...initial direction
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.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.
in which of the two holes should go a cockroach in this case?
Teaches assertions in regular expressions. Must be approved. Nice kata
and how long?)
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
sorry
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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)
sorry for asking. in the solutions above, where the split method is used twice in a line, does it affect performance in general, or are the list cached?
Not in general, but coz autor make 'k' less or equal than length of sequence, it is work
Loading more items...