Ad
  • Custom User Avatar
  • Custom User Avatar

    ive been having the same issue, and trimed white space but the error shows:

    input string: .-
    .
    ..
    . .
    .
    .
    Expected: i

    Expected: is "E*E"
    but: was "EE"

    and when i don't trim white space i get the error you were having.
    clearly im having an issue with the double 'E'.

  • Custom User Avatar

    Are you sure about this? To me it looks like do gets an array of "lifted" functions, i.e. do(Maybe, (x => Maybe)*) => Maybe.

    But I agree that it would be nice to have these details somewhere.

  • Custom User Avatar

    I suddenly feel like a monkey with a typewriter

  • Custom User Avatar

    [Javascript]

    Implementing Maybe.do is much easier once you have the details!

    m is a list of arguments- m[0] is the Maybe Monad and m[1...] are functions of signature value -> value.

  • Custom User Avatar

    Removing all spaces you get at the start end end of your final string should work.

  • Custom User Avatar

    I can't seem to be able to use Arrays, is there something I have to do diferently in codewars?

  • Custom User Avatar

    Last two C# tests are broken. Three spaces must be turned into a single space in the output, but the whitespaces in the input string and the expected result are not consistent.
    Here's what you get for the two tests- I've used * to denote a space.
    The rest of the tests pass, and some use whitespace so it isn't a corner case.
    input string: ..*
    Expected: "EE"
    But was: "EE"

    input string: ...---...-.-.---.....--.-..-..-.-.-.--....-.---.---...-.----..-.---..---.--....---...-..-.-......-...---..-.---..-----.*.-.-.-**
    Expected: "SOS! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."
    But was: "**SOS! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." (only the first two spaces were incorrect)

  • Custom User Avatar

    For the F# version, I was annoyed by the two aspects:

    1. That the tests rely on a "addShape" function that is not mentioned in the challenge or defined by the test code.
    2. That, by relying on the above method to construct a list by mutable tail concactenation, it is not possible to write performant, idiomatic F# (ie. build the list and then optionally call List.rev)

    The order of the input list shouldn't matter at all to the test, and yet it clearly does in this case.