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.
That would make it too easy!
A method that returns either an array index or a value (they at least happen to have the same type) depending on a string you pass as an argument? The hardest thing about this kata is forcing yourself to write something so awful.
There's nothing wrong with the solution at all, just with its ranking as best practice.
This is not remotely best practice, yet it currently has the most best practice votes.
It's half-way clever for its brevity, but definitely not best practice due to inefficiency.
Has no one noticed that the haskell kata tests expect the arguments in a different order from what's in the initial code:
code (and Prelude): dropWhile :: (a -> Bool) -> [a] -> [a]
tests: dropWhile :: [a] -> (a -> Bool) -> [a]
(Well, evidently many people have noticed, but no one has fixed it).
Well, that's your job to find out. But as a hint: you should test properly what your method returns.
You may well get the right values in min and max, but your solution is still not correct.
It's not really cheating, it just has a rather basic error. You should test it a bit more.
The haskell testcases also have ""smaller"" and ""larger"", which both behave like "smaller".
Unknown errors are caused by some codewars error, not by your code or the kata. Try submitting again until you get a proper message.
This is an unnecessarily ugly solution now, because most of it was for preserving the order of whitespace - until it became clear that anything other than a single space is considered part of a word...
It's not clear from the description whether space means any whitespace (which would be more logical) or just single spaces. For the final testcases it's just single spaces.
It ought to be flexible enough with the latest edit.
This comment is hidden because it contains spoiler information about the solution
Loading more items...