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.
there is such a thing as markdown formatting, particularly for code you enclose it in triple backticks:
```
your code
```
anyway, from what I managed to clean from that mess is that you're mutating the array while looping over it. don't do that. If you delete items, the arrays size changes, and so your
n
will quickly become invalid as it is now too large.Don't post solutions in Discourse, and use a spoiler flag as soon as you post code somewhere (I put the flag on for you this time).
Your code is buggy and producing an error. It tells you exactly what the error is:
arr[n]
is not ina
. Insert print statements to track the values and pinpoint what is going wrong.