Ad
  • Default User Avatar

    I'm currently trying to solve this kata in R, but I think there is an error with the expected value in test 3. My code (and also a simple calculator) give me 81 as solution, but 80 is expected.

    Test Input:
    s: 12
    x: c(0, 0.11, 0.22, 0.33, 0.44, 0.65, 1.08, 1.26, 1.68, 1.89, 2.1, 2.31, 2.52, 3.25)

    Maximum can be found in position 8 which is [1,91 - 1,47]
    Doing some math, I get: ((1,92−1,47)/20)⋅3600 = 81
    and not 80.

    So currently, I cannot solve the kata in R unless I cheat.

    Update: Seeing it in other comments, I cannot resolve this issue by using "floor". To complicate it even more, I have to use floor(round(v, 6)) to pass all the other tests. Apparantly, R math deviates quite significantly from the expectation in several cases.

  • Default User Avatar

    Yes. Not pretty - but I still wanted those credits ;)

  • Default User Avatar

    apparently, that was to make sure to handle the {input == 0} case separately...

  • Default User Avatar

    It still doesn't seem to be fixed yet. As many reported, in the hiragana test case,
    \ufffd
    Was presented as part of the solution after encryption, but it is NOT part of the alphabet. And it was NOT part of the original text. Because it does not originate from the text (and could only come from a shift within the given alphabet) it should never be part of that solution.

    Edit: I bypassed the last test by obvious means. But I guess it would be better to solve the test case :).