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.
I do not need the unique constraint.
Description fixed.
Actually, your static example #1 contains
4
two times. And the "random lists" does so too. Both those things are fixable, but do your really need lists of unique ints?Fixed
Thanks
The initial solution still has
Oldest
as module name:Maybe there's some caching which prevents your changes?
Module name was Ok.
Removed Test.Quickcheck from example test cases
Corrected type of my solution and user's one.
Included your Quickcheck random test (Thanks!)
The initial solution has a wrong module name
Oldest
instead ofSumUpNoAdjacents
. Also, your example test cases includeTest.QuickCheck
, but don't actually use QuickCheck.Your test cases include both
Data.List
andTest.QuickCheck
but use neither, although your solution is included. Probably because QuickCheck timed out, right? You canresize
the size of a generated value:That way the list won't be too large, and the computation won't time out.
Also, your solution and the user's solution differ in their type: While you use
[Int] -> Int -> Bool
, the user has to write(Num a, Eq a) => [a] -> a -> Bool
.Module name: fixed
"it" was just bad indented
Thanks
Module needs to remained, and the test doesn't compile. (Uses "it" name which isn't defined.)
A fair point, but I'm sure people are clear as to what I'm meaning.
Err..Sorry I was speaking about the haskell version.
the [a] datatype in haskell is called a list (because it /is/ a linked list).
There are arrays in Data.Array and its sub modules.
This comment is hidden because it contains spoiler information about the solution
I doubt any 'bad' solutions could pass the test case for an array of length 500!
There is only one "good" solution here. In my opinion, you should not suggest bad ones...
This is not true. In python, your statement is acceptable, but in all other implemented languages 'list' doesn't exist.
It takes an list not an array.