Ad
  • Default User Avatar

    That would make it too easy!

  • Default User Avatar

    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.

  • Default User Avatar

    There's nothing wrong with the solution at all, just with its ranking as best practice.

  • Default User Avatar

    This is not remotely best practice, yet it currently has the most best practice votes.

  • Default User Avatar

    It's half-way clever for its brevity, but definitely not best practice due to inefficiency.

  • Default User Avatar

    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).

  • Default User Avatar

    Well, that's your job to find out. But as a hint: you should test properly what your method returns.

  • Default User Avatar

    You may well get the right values in min and max, but your solution is still not correct.

  • Default User Avatar

    It's not really cheating, it just has a rather basic error. You should test it a bit more.

  • Default User Avatar

    The haskell testcases also have ""smaller"" and ""larger"", which both behave like "smaller".

  • Default User Avatar

    Unknown errors are caused by some codewars error, not by your code or the kata. Try submitting again until you get a proper message.

  • Default User Avatar

    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...

  • Default User Avatar

    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.

  • Default User Avatar

    It ought to be flexible enough with the latest edit.

  • Default User Avatar

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

  • Loading more items...