Ad
  • Default User Avatar

    I just published the R translation of this Kata.
    Please, check it out and comment or approve it.

    It is my first Kata translation, so I am open to any constructive criticism.

  • Default User Avatar

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

  • Default User Avatar

    In R, only a few libraries can be loaded in the soluntions, and non of them contains a function to test prime numbers or factorize numbers. So, I wrote my own code. It works but it runs out of time.

    Any suggestions or tips to beat the clock?

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Let me rephrase. I know it's solvable. Do you have any suggestions to optimize O(n) code in R? I am unsure which operations are more time consuming or if I should use a particular package

  • Default User Avatar

    I run out of time with this kata in R. I am pretty sure my code is O(n), but I got stuck at approx. 54 test cases. Suggestions accepted!

  • Default User Avatar

    Got it! Thanks mate

  • Default User Avatar

    Can you please elaborate further? I do not define any dictionary in my solution, which contains only a list within the function scope and returns a string. I think the definition of the problem does not request any dictionary

  • Default User Avatar

    I think there is an issue with tests in Python. My code passes all tests, but I get a STDERR message:

    Time: 508ms Passed: 10 Failed: 0 Exit Code: 1

    Test Results:
    Example from description [...]
    Basic Morse decoding [...]
    Extra zeros handling [...]

    STDERR
    Traceback (most recent call last):
    File "/workspace/default/tests.py", line 30, in
    testAndPrint(decodeMorse(' . . '), 'E E')
    File "/workspace/default/solution.py", line 11, in decode_morse
    msg += MORSE_CODE[char]
    KeyError: ''