Ad
  • Custom User Avatar

    Nothing wrong with this, but you could just remove the return keyword and the ; symbol.

  • Custom User Avatar

    Ah yes, I had a sinking feeling last night I may have inadvertantly asked you to solve the halting problem there so apologies for that!

  • Custom User Avatar

    I'm glad it helped. I will see what I can do (at least a hint in the description).

    edit: Sadly I can't test dropS as it will traverse an infinite spine. Therefore I would have to test with a timeout. I'm not sure whether that's possible.

  • Custom User Avatar

    Thank you so much for your suggestions - it was dropS not handling negatives that was the killer. Is it possible to add a failing test for this?
    I will have another attempt at getting pure stream based fibS and primeS. Thanks again :)

  • Custom User Avatar

    Things that I noticed:

    • dropS: not working for negative numbers
    • fibS: That's not how you should solve it (without lists please). (Hint: Think about a recursive definition of fibonacci numbers by using the stream itself.)
    • primeS: I can't see what's the issue here, but again don't use lists please. Look up how a prime sieve algorithm works and implement it using streams. (It's very short, I promise and even bad ones should work.)
    • Other that that it might also be related to codewars. Are you blocking JavaScript?
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I have even tried https://hackage.haskell.org/package/primes-0.2.1.0/docs/Data-Numbers-Primes.html and it still times out.
    Again, the sample tests work fine. I'm running out of ideas, checking my Fibonacci solution.

  • Custom User Avatar

    Really struggling to pass the final tests - I suspect my primeS is too inefficient.
    Can anyone offer any hints? I've tried to translate lazy list based approaches to streams but nothing seems fast enough to pass the tests.

  • Custom User Avatar
  • Custom User Avatar

    Is "the minimum number of letters you have to add, remove or replace in order to get from the entered word to one of the dictionary" not the definition of the distance algorithm required? Or is it not that precise?

  • Custom User Avatar

    I found this very challenging, and honestly I'm still quite mystified by Monads but this has been a little confidence boost and a step further to a deeper understanding of the topic.