Ad
  • Default User Avatar

    hey, I tried to compile this in c and the tests worked until the random ones where it got a error code 6. i was allocating the array with calloc and the stderr said something with free(): invalid next size (fast), you sure you free it in the right way? because from what i read err 6 can mean a heap overflow

  • Custom User Avatar

    Very fun kata, a little to easy for 6kyu.

    Idk why people had a problem to understand the task. I didn't know what is a deadfish either but by looking at a description of kata and examples I didn't had to.

  • Custom User Avatar

    sorry but the explanation of this Kata is not very good, I had to google it to actually understand it.

  • Custom User Avatar

    You are checking whether the string contains specified characters. Instead, you should check whether the current character that you are iterating thru the string matches either one of (i / d / s / o) or other invalid characters

  • Custom User Avatar

    Should be 7 kyu;

  • Custom User Avatar

    Scala: assertion messages are unhelpful:

    DeadFishTest
    DeadFish.parse should work with example tests
    Test Passed
    Completed in 23ms
    DeadFish.parse should work with fixed tests
    Test Failed
    c (of class java.lang.Character)
    Stack Trace
    Completed in 4ms
    DeadFish.parse should work with random tests
    Test Failed
    O (of class java.lang.Character)
    Stack Trace
    Completed in 28ms
    

    I fear tests can be suject to overflow like other languages.

  • Custom User Avatar

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

  • Custom User Avatar

    CS: no basic tests and only 7 random tests.

  • Custom User Avatar

    very easy,that should be 7 kyu

  • Default User Avatar

    What's Deadfish?

  • Default User Avatar

    I guess that this could be 7kyu atleast.

  • Custom User Avatar

    I don't get it why my solution do not pass random test...
    This kata is too easy for 6 kyu

  • Custom User Avatar

    There is no need to post solutions in the discourse. If you want to show @f1e how their solution can be refactored, you could fork their solution, or comment on it.

  • Custom User Avatar

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

  • Custom User Avatar

    Good question. People will say blanket things like "for loops are always faster", but it -really- depends on every individual use case. So you might want to create solutions for each to the best of your ability, then benchmark them.

    Here are a couple of the top solutions (one for switch statement, and one for for loops) benchmarked against each other: https://jsbench.me/e3lh84u45z/1

    It seems like the switch statement solution is 11% faster, but you'll notice the for loop example has some regex bloat in there which is probably slowing it down.

    Create your own clean solutions and benchmark them yourself. It's kinda fun.

  • Loading more items...