Ad
  • Custom User Avatar

    Fixed for Python

  • Custom User Avatar

    every time I use them I feel disgusted with myself but do it anyways because it looks cool

  • Custom User Avatar

    During which test does this happen? What parameters did QuickCheck generate? Also, could you (again) share your code? There might be some floating point problems which I didn't address when I originally translated the kata.

  • Custom User Avatar

    It asks for any kind of strings. This includes "". Note that the tests cannot get changed since there were already +500 solutions (see also 1 and 2).

  • Custom User Avatar

    If a is zero, you have 0x² + bx + c = 0. You should be able to solve that one without the formula ;).

  • Custom User Avatar

    Yeah, no. The tests actually check inArray ["",…] …. g964's description didn't contain any remarks whether empty strings could be in the first array, so I took the liberty to include them.

  • Custom User Avatar

    My isSubstringOf returns the string if it matches and "" if it doesn't

    What if the string is ""? isSubstringOf [] ys returns []. But the empty string is a substring of any string: "abc" = ['a','b','c'] = 'a' : 'b' : 'c' : []. And that's where filter ([] /=) fails. That's why I suggest you to write

    isSublistOf :: Eq a => [a] -> [a] -> Bool
    
  • Custom User Avatar

    Your combination of isSubstringOf and filter isn't correct: the empty list is a prefix of any other list. Try to write isSubstringOf as Eq a => [a] -> [a] -> Bool instead of Eq a => [a] -> [a] -> [a]. In particular, make sure that

    quickCheck $ \ys -> [] `isSubstringOf` ys
    

    passes all tests.

    Also, you should have a second look on your current definition of isSubstringOf. The second pattern will get matched only in a single situation, e.g. y == [].

  • Custom User Avatar

    @bkaes: could you have a look?

    I don't get a notification. If you want to make sure that I actually read these messages, message on Gitter. Please don't cross-post to other katas.

    That being said, I can't really repdrocue the behaviour. Balin, could you share your code in a spoiler? Please user proper formatting while doing so:

    ```haskell
    inArray a1 a2 = a1 /= a2
    ```
    
  • Default User Avatar

    I'm not the haskell translator but I'm surprised!
    @bkaes: could you have a look?

  • Custom User Avatar
  • Default User Avatar

    I totally agree with MMMAAANNN. This kata is very easy but sometimes Codewars is too busy or something like that and it times out. The time-out is not an "Issue" for this kata. Try again later and it will work if your solution is, as you said, a reasonable one.

  • Custom User Avatar

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