Ad
  • Custom User Avatar

    (Ruby) When the weights are the same ie: "30KG", "30000G", "30KG" only the order that starts with KG is accepted: "30KG", "30KG", "30000G".
    Also "90000G", "90KG" is not acceptable, but "90KG", "90000G" is.

  • Custom User Avatar

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

  • Custom User Avatar

    Ruby: on the test's if I had raise "Error" if (wrong type,etc)...then the tests would fail.
    But if I put return "Error" if (wrong type,etc) they passed. The opposite is true for final submission.

  • Custom User Avatar

    I hit submit a few more times and it worked. Whatever.

  • Custom User Avatar

    I'd have this kata solved in ruby except out of the hundreds of scores one improvement is -57.49999999999999. 13 nines rounds to -57. If my value had 14 nines then it would round to -58, which is the answer for the test case.

  • Custom User Avatar

    I was not able to pass final submission. All of my test cases work in IRB. I have more than a few katas in my unfinished pile that work in IRB & I think should work. Let me know if you get it to work.

  • Custom User Avatar

    Has anyone solved this in Ruby? I keep coming back to this one and cannot get a solution that does not time out.

  • Custom User Avatar

    ah, subtract in kind to only leave positive values.

  • Custom User Avatar

    how can [1,0] and [0,1] yield the same answer? (1)?

  • Custom User Avatar

    (Ruby) cannot pass the invalid string input tests (only for submit, test button works). If I return 'error' or false, I still get: "The function somehow worked with wrong input"

    "6F43E8"
    "Error"
    The function somehow worked with wrong input
    "1234 "
    "Error"
    The function somehow worked with wrong input
    ""
    "Error"
    The function somehow worked with wrong input

  • Custom User Avatar

    Not sure why this is failing (ruby). On the second to last test, the expected result for (:player2=>[[5, 5]]) isn't even on the input array to the function.

    Creature battles
    [[1, 1]]
    [[1, 1]]
    Test Passed: Value == {:player1=>[], :player2=>[]}
    [[2, 2]]
    [[1, 1]]
    Test Passed: Value == {:player1=>[[2, 2]], :player2=>[]}
    [[1, 1]]
    [[2, 2]]
    Test Passed: Value == {:player1=>[], :player2=>[[2, 2]]}
    [[1, 1], [2, 1], [2, 2], [5, 5]]
    [[1, 2], [1, 2], [3, 3]]
    Test Passed: Value == {:player1=>[[5, 5]], :player2=>[[1, 2], [3, 3]]}
    [[1, 2], [1, 2], [3, 3]]
    [[1, 1], [2, 1], [2, 2]]
    Expected: {:player1=>[[1, 2], [3, 3]], :player2=>[[5, 5]]}, instead got: {:player1=>[[1, 2], [3, 3]], :player2=>[]}
    []
    [[1, 1], [2, 3], [10, 10]]
    Test Passed: Value == {:player1=>[], :player2=>[[1, 1], [2, 3], [10, 10]]}

  • Custom User Avatar

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

  • Custom User Avatar

    I can't figure out the prbblem here (ruby). On final submit i get the error message: (page_index returned incorrect value when provided a item_index argument that was out of range)
    Even though all of my tests pass?!
    Test.assert_not_equals(helper.page_index('f'), 3)
    Test.assert_equals(helper.page_index('f'), 1)
    Test.assert_equals(helper.page_index('a'), 0)
    Test.assert_equals(helper.page_index(-12), -1)
    Test.assert_equals(helper.page_index('bollocks'), -1)
    Test.assert_equals(helper.page_index(nil), -1)
    Test.assert_equals(helper.page_index(false), -1)

  • Custom User Avatar

    Ah, thanks. Despite trying a few different approaches I can't get the final calculation done in under 6 seconds. Some of the requirements of these problems are very opaque.

  • Custom User Avatar

    My (Ruby) solution passes all test on this website & my own, yet get error message:
    each': failed to allocate memory (NoMemoryError) from to_a' from solution' from block in
    '
    from wrap_error' from it'
    from it' from
    '
    Ugh. Infuriating.

  • Loading more items...