Ad
  • Custom User Avatar

    I copied your latest C# code and it passed the tests, closing!

  • Custom User Avatar

    This is not a pythonic way, :(

  • Custom User Avatar

    @James171, that code doesn't work, and why overwrite the var you use in the loop? Mutating the input is also a bad practice, and if you fix those 2 things, your code also suffer of poor performance with long inputs, so you too, take a look at the tests cases, try to figure out a way for creating the output with a single loop (you have nested loops there because reduce is a loop-alike method). I can't tell you more without spoiling it, good luck.

    P.S.: this can help you check what your code does step by step.

  • Custom User Avatar

    @maurobono your code is highly inefficient. Try another approach, see the example tests and try to figure out a pattern, linear solutions can be achieved here.

  • Custom User Avatar

    Without seeing your code we can only guess, but the kata works in Javascript (just tested it), so it must be a problem with your code.

  • Custom User Avatar

    real confused - when I run this in chrome console I get the correct answers - when I run in the test I get the following....

    expected [ 20, 20, 19, 16, 10 ] to deeply equal [ 20, 20, 19, 16, 10, 0 ]

  • Custom User Avatar

    if that happens with the greenish "submit" button, it sounds like a cw problem. Nothing to do except to wait for some time and try again later (and if persistent, raise an issue on the github repo).

  • Default User Avatar

    My solution on the attempts is good and works well, but when I am going to submit it, it returns this: "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
    Aborted (core dumped)" It seems a memory issue (!?) Can someone help ? thanks!

  • Default User Avatar

    Thanks!

  • Custom User Avatar

    Awesome kata, @g964 thx!!!

  • Custom User Avatar

    Strange thing with C# random tests group-2: in both tests the 2nd number in actual answers always differs from expected in several units, while absolutely the same algorythm in Python works OK. Is the problem with my code or with tests? Codes in Python and C# are the same (except for syntax, of course).

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    The third argument should be v, not n, according to details.