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.
When trying to Submit solution I'm getting this, even though after clicking Run Tests button the tests are passing. Anyone else experiencing this?
This comment is hidden because it contains spoiler information about the solution
Extraneous words in the initial sentence of the description: "In this Kata you need to will need to write two methods."
Cool. The degree of similarity is astonishing :)
I like this kata. But I've got problem with the fact that the naive Haskell implementation of "pretty" (using ++), which has potentially quadratic complexity (and incidentally is also the way that most solutions are implemented) is promoted as best practice solution. In order to spread the word and promote good Haskell programming practices I would:
e.g:
bigRazor = foldl f (Lit 0) [1..10000] where f r i = Add r (Lit i)
-- and the test would for example just check the lenght of the resulting String
In that case the instructions should be changed from "the string CONTAINS the word hallo .." to "the string STARTS WITH the word hallo" to remove the ambiguity.
Haskell test cases are incomplete.
I noticed one user had solution which was incorrect, but still it passed the tests:
isBalanced :: String -> Bool
isBalanced xs = count '(' xs == count ')' xs
where count c xs = length $ filter (== c) xs
--> A test case should be added which hase the same number of L/R parenst, but which are not balanced, e.g. ")("
The same problem here, seems like a bug in the test.
Falsifiable (after 12 tests):
expected: False
but got: True
"foo bar bar salut textbook"
Nice. If you start the infinite list with 0 you can replace (i-1) with i, making the solution even more conscise :-)
No need for the cases "accum [] = []" and "rep 0 c = [toUpper c]"
because replicate 0 _ = [] and intercalate _ [] = []
Otherwise nice solution.
Cool, I love these things that lazines brings :) Thanks for explanation.
Will this not break with empty list?
λ> minimum []
*** Exception: Prelude.minimum: empty list
Though this solution is clever, note, that "concatMap inits . tails" produces a list of substrings that is quadratic in the lenght of input arguments. To answer this question it might be sufficient to look for substrings of length 2 of s1 in s2.
In my opinion (backed by Wikipedia https://en.wikipedia.org/wiki/Vowel#Written_vowels) there are 6 vowels in latin alphabet. Namely: a, e, i, o, u, y.
In Haskell test fixture there are some test cases containing the letter y ("bialy"), but the assert says the vowel indexes are [2,3], whereas they should in fact be [2,3,5].
In other words letters 'y' and 'Y' should be considered vowels by the test fixtures, but they are not.
But it might be some linguistic confusion from my side :-)