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.
This kata is evil, cool but hard 😥
I found some testcases, where the Codewars environment shows different results than my program:
number of walls: 6
walls = (
[ (Point(6, 2),Point(7, 1))
, (Point(7, 4),Point(6, 3))
, (Point(1, 2),Point(3, 0))
, (Point(2, 1),Point(0, 3))
, (Point(9, 1),Point(8, 2))
, (Point(6, 4),Point(7, 5))
])
width = 10
height = 5
expected = False
Your answer: True
Here the 2 overlapping edges (Point(1, 2),Point(3, 0)) and (Point(2, 1),Point(0, 3)) form a partition with upper and left boundary walls.
Another testcase:
number of walls: 11
walls = (
[ ((22, 7),(19, 5))
, ((21, 6),(21, 4))
, ((24, 7),(24, 6))
, ((18, 8),(18, 8))
, ((17, 8),(17, 8))
, ((23, 8),(24, 9))
, ((17, 9),(17, 7))
, ((19, 8),(16, 8))
, ((16, 9),(14, 9))
, ((20, 9),(17, 7))
, ((18, 9),(17, 6))
])
width = 40
height = 16
expected = False
Your answer: True
There are 2 partitions in the center.
Thank you for this great kata. I learned a lot about how to handle graphs in python.
Haskell translation
remember to close your question when it is answered ;-)
Thank you, I was struggling with it and you cleared my mind with that insight!
see here
I think that may be the intended lesson of the kata (locality of reference for row-major matrices which makes more efficient use of the cache)
Hey, I have an issue and is I am not able to get the final test to work since I always get when I return the empty array, but when I add something to it there is no problem at all. I am really curious to know if I am getting something wrong and what could it be, can someone give me a little help?
C translation
nah this is more like a 7
OK. I still have to get used to scott and its pattern matching features lol
Nice one
Loading more items...