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.
@jean.pumarol, your solution is inefficient.
I know that you posted this some time ago. I had the same problem with memory overflow. I refactored my code and now I dont have that problem. But now I have an exit code, because of execution timeout. Did you finally solved it?
++++++function whoIsNext(names, r){
++++++let num = 0
++++++while((names.length + num) < r) {
++++++let name = names.shift()
++++++names.push(name, name)
++++++num += 1
++++++}
++++++return names[r-num-1]
++++++}
It seems it's a memory overflow problem. There are tests with long values.
This comment is hidden because it contains spoiler information about the solution
What a strange error message, I've just tested it with a couple of solutions and it works, try sharing your code in a post marked as having spoiler content so we can help you.
I believe this kata is broken for javascript.
I've tried two solutions that work with each test passing. Yet I get an error in red in both cases:
Log
<--- Last few GCs --->
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x3f47d93cf781
2: whoIsNext [/home/codewarrior/index.js:~5] [pc=0x3d098205ff53] (this=0x235e1eecb801 ,names=0x313af0c91899 <JS Array[79300100]>,r=1000000000)
3: /* anonymous / [/home/codewarrior/index.js:65] [pc=0x3d098205c09c] (this=0x235e1eecb801 )
4: / anonymous */ [/runner/frameworks/javascript/cw-2.js:159] [pc=0x3d098205a1bc] (this=0x235e1eecb801 <JS Glob...
STDERR: