Ad
  • Custom User Avatar

    Revised, should make more sense now.

  • Custom User Avatar
  • Custom User Avatar

    Your suggestion doesn't make any sense, especially Line 3, and Line 4 is hard to understand.

  • Default User Avatar

    the list was 107 158 204 100 118 123 126 110 116 100

    Read carefully the tests results. You don't fail this test.

    Test Failed
    	`actual` not equal to `expected`.
    	Length mismatch: comparison on first 3 components
    	Component 3: Mean relative difference: 0.8214286
    

    This is for the previous one. Your output is above the result of the test.
    Rather look at the previous one: testing(c(15,21,24,30,-45)... and verify your result by hand.
    Hope this help.

  • Default User Avatar
  • Default User Avatar

    Would you mind having a look?

    Notice that it is a question, not an issue:-)
    I tried several solutions and all worked fine. 23 guys passed the R kata; not a lot but I think it is enough to say there is no error in the tests. Moreover you are failing some of the fixed tests that are the same in other languages.

    looks like a rounding problem on testing side

    There is no rounding in the tests. They simply compare the actual and expected results but it seems that R tests give an indication of the falsety by indicating a difference of mean which is without interest.
    You should give an exemple of input with your output for a failed test so I can give you the expected result for this test.

  • Default User Avatar

    Try again now. Should be ok.

  • Custom User Avatar

    Not a kata issue. Use System.out.println(s) to see input.

  • Default User Avatar

    The description says:

    The function takes the parameter: n ... returns an array or a string (depending on the language) of the form: [(a, b), ...] or ...

    and the tests make it clear.