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.
Works fine now.
the
fromEnum Reaction
!I'm happy to see it getting used; my example solution doesn't, but did
instance Enum LoveLanguage
( andBounded
, and should have used more of that ), so I threw it in forReaction
as well. I don't remember if I consciously ordered them correctly, but I did - all's well that ends well. :DI had the same problem, was wondering if i got it wrong, entered a similar solution in Python and then it passed. Something seems to be wrong with the Haskell tests.
That's a known problem with preloaded code. That happened shortly after I translated the kata, sorry. However, you can simply remove the import and add
normalize
, which should be something likeI cannot run the tests.
This kata would have been interesting if the results squares could be — as I initially assumed — of any size (3x3, 2x2, etc.). What you're asking is both unclear and uninteresting.
There are no test cases in the Haskell version, and the tests fired upon submission do not match the description: random tests not only include negative input values, but are also expecting nonzero answer in such cases.
This comment is hidden because it contains spoiler information about the solution
At first I didn't get it but after several hours I've foundbseveral approaches to do this; having chosen the best one it turned out to be the same as what you linked to :) I think key was being able to hold the whole problem in my head at once. That made it easier to reason about it. Try deriving the solution on your own; see where that gets you. You need to spend a lot of time on it though. I think this kata should be more than 6 kyu, maybe 5 or 4.
I understand. I don't particularly like this kata. If like me you didn't "get it", you'll probably turn to Google for help. Lo and behold, the first result is the current best solution on here.
You've implemented foldl from ground up rather than using foldr in a cool way. Try doing that instead as the kata asks.