Ad
  • Custom User Avatar

    State the language, is it C?

  • Custom User Avatar

    Instructions are a bit inaccurate with regards to what is asked, for example instruction asserts that 'return an empty array', but you actually have to return NULL.

  • Custom User Avatar

    Approved

  • Default User Avatar

    [2, 4, 6, 8, 0, 2, 4, 6, 8, 9, 10, 11, 12, 12] should equal [2, 4, 6, 8, 0, 2, 4, 6, 8, 9, 0, 1, 2, 2] means that your function returned [2, 4, 6, 8, 0, 2, 4, 6, 8, 9, 10, 11, 12, 12], but it should have returned [2, 4, 6, 8, 0, 2, 4, 6, 8, 9, 0, 1, 2, 2] instead. The original input for that test is [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 8]. Your function works mostly correctly, but there's something in the kata description that you're missing that is causing you to fail.

  • Custom User Avatar

    I think you're misreading something, maybe the error you get is [2,4,3] should equal [2,4,6]? In that case [2,4,3] is what your function wrongly returned, not the input value.

  • Custom User Avatar

    How does [2,4,3] result in [2,4,6]? I must be misunderstanding the question completely. I wouldd have thought it should result in [3,6,6]]

  • Custom User Avatar

    Apologies, I'm an SQL newbie. Shouldn't the name of the table containing the demographics records be provided? I thought I would have to query a table in order to count by unique race. Or perhaps I'm misunderstanding what is required..

  • Custom User Avatar

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

  • Custom User Avatar

    Are you sure about that test? If the input is 2, the answer should be also 2 (see the post above)

  • Default User Avatar

    Because 3 is a prime number, its the nearest prime to 3. The same for 11.

  • Custom User Avatar

    I've struck a problem running my code. Nothing happens! It runs fine in my IDE. Any suggestions would be great.

    Also,some of the test examples are listed below. The 2 here have answers that I find puzzling. Are they correct?

    Test.it("Basic tests")
    Test.assert_equals(solve(3),3)
    Test.assert_equals(solve(11),11)

  • Default User Avatar

    1 is not a prime number.

  • Custom User Avatar

    The instructions say that if 2 numbers are equidistant from the start and are both primes, then the result should be the lower of the 2.
    But then in the tests it gives solve(2) = 3. Shouldn't it be solve(2) = 1?