Ad
  • Custom User Avatar

    'NO' should equal 'YES'

    This test case expectation is for array above the printed text (not below). The one you showed expects 'NO'.

    Also, if you open a new thread, please continue there, don't create new ones for no good reason.

  • Custom User Avatar

    Thank you. This is what I am getting:
    'NO' should equal 'YES'
    Log
    [25, 25, 25, 25, 25, 100, 100]

    Test case seems to be wrong or am I readin something incorrectly? There is no change left for the 2nd 100...My logic is saying "NO", Test case is expecting "YES".

  • Custom User Avatar

    'NO' should equal 'YES'
    Log
    [25, 25, 25, 25, 25, 100, 100]

    Test case seems to be wrong or am I readin something incorrectly? There is no change left for the 2nd 100...My logic is saying "NO", Test case is expecting "YES".

  • Custom User Avatar
  • Custom User Avatar

    I am failing 1 of the 20 test cases but cannot get any details on the input that is being used for that particular test casse. Can anyone help me here?

  • Custom User Avatar

    the error message is most probably caused by the fact that OP's solution has a side effect (it mutates global variables), and is called twice. First call returns a correct result, but its used only to build an assertion message. the next call uses mutated state and returns invalid result, assertion fails, and the message composed in the previous step (i.e. the one with the correct answer) is displayed.

    Test suite is wrong because it calls user solution twice. Solution is wrong because it uses global variables.

  • Custom User Avatar

    Well, I'm not sure how you got that error message, because for me your code produces other problems, like

    solution.c:13:10: error: use of undeclared identifier 'first_numn'; did you mean 'first_num'?
    

    because of the syntax issue of apparently intending to show multiplication of first_num * n instead. This also happens at 2i which should be 2 * i. Finally, you also have variables declared outside the function that should be inside the function. That might be it, just don't forget the include the inttypes header.

  • Custom User Avatar

    Please see here on how to post code in kata discourse: https://docs.codewars.com/references/markdown/#code-block

  • Custom User Avatar

    @rowcased, please let me know if that works for you to view my logic.

  • Custom User Avatar

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

  • Custom User Avatar

    Hi @RJ20192, can you please post your code with proper markdown and a spoiler tag? I have a guess as to why your code might fail but I'd like to see why you're getting that error message, thanks.

  • Custom User Avatar
  • Custom User Avatar

    Which language?

  • Custom User Avatar

    I am getting an error "rowSumOddNumbers(2) should return 8, actual: 8", I can't seem to see the issue here. Can someone please help me?

  • Custom User Avatar

    A bit of thought shortcut on my part, what I meant is that if you understand what this kata is about answer to your question is trivial, but without you stating what you know and what you don't, there's no way to tell what explanation you expect.

  • Loading more items...