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.
Could someone explain to me how the line below works for the description?
if 2 < len(cells & get_neighbours(x, y)) < 4 + ((x, y) in cells)
from my understanding the above would match on 3 for a dead cell and 3 or 4 for a living cell but the description for the challenge dictates 3 for a dead cell and 2 or 3 for a living cell (not 3 or 4), would really appreciate if someone could help me figure out what I'm missing?
And sorry about the code formatting, not sure what the delimeters are here, please let me know and I'll edit
For clarity, the ones I mention taking 3-4 seconds are the given tests on the webpage, these ones in this case: import Test.Hspec
import Test.QuickCheck
import Josephus (josephus)
spec :: Spec
spec = do
describe "josephus" $ do
it "works with integers" $ do
josephus [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 1
shouldBe
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]josephus [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 2
shouldBe
[2, 4, 6, 8, 10, 3, 7, 1, 9, 5]This comment is hidden because it contains spoiler information about the solution
Ahh, googling only returned splitAt, wish I had found splitOn