Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I copied your latest C# code and it passed the tests, closing!
This is not a pythonic way, :(
@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.
@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.
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.
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 ]
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).
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!
Thanks!
Awesome kata, @g964 thx!!!
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).
Java Translation kumited
This comment is hidden because it contains spoiler information about the solution
The third argument should be v, not n, according to details.