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.
Fixed for Python
every time I use them I feel disgusted with myself but do it anyways because it looks cool
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.
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).If
a
is zero, you have0x² + bx + c = 0
. You should be able to solve that one without the formula ;).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.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 wherefilter ([] /=)
fails. That's why I suggest you to writeYour combination of
isSubstringOf
andfilter
isn't correct: the empty list is a prefix of any other list. Try to writeisSubstringOf
asEq a => [a] -> [a] -> Bool
instead ofEq a => [a] -> [a] -> [a]
. In particular, make sure thatpasses 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 == []
.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:
I'm not the haskell translator but I'm surprised!
@bkaes: could you have a look?
No worries. The timeout messaging is currently rather poor. See this page for an explanation of the various timeouts.
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.
This comment is hidden because it contains spoiler information about the solution