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.
About the pattern:
Try using some math to predict the value on the passed position without building the whole list, that's the most I can tell without spoiling it.
Building the queue like that won't work (also, that's not a copy, it's another reference to the same array, mutating queue will mutate names because the array is the same). Shift and slice are in the worst case O(n) so those count like nested loops in time complexity. Also, building an array with so many items will exhaust memory at some point. You'll have to find a pattern instead so you can save cycles.
Could you post your current code using markdown formatting and marking your post as having spoiler content? Some array methods have loops under the hood, and that's why it times out.
Nested loops won't work, single loops works tho, use a more mathy approach.
(for JS): There's 10 fixed tests, 50 short string tests, and 10 long string tests (70 total), so you're probably timing out at long strings =/
For reference, average solution takes about 9-10s.