Ad
  • Custom User Avatar

    Works fine now.

  • Custom User Avatar

    :heart: the fromEnum Reaction !

    I'm happy to see it getting used; my example solution doesn't, but did instance Enum LoveLanguage ( and Bounded, and should have used more of that ), so I threw it in for Reaction as well. I don't remember if I consciously ordered them correctly, but I did - all's well that ends well. :D

  • Default User Avatar

    I 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.

  • Custom User Avatar

    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 like

    normalize :: Alphabet -> String -> String
    normalize (Alphabet (zero:_)) xs = case dropWhile (==zero) xs of
                                         [] -> [zero]
                                         xs -> xs
    
  • Custom User Avatar

    I cannot run the tests.

    Could not find module `BaseConversion.Normalize'

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    You've implemented foldl from ground up rather than using foldr in a cool way. Try doing that instead as the kata asks.