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 understand, thank you for the explanation!
This can be changed by making a copy of the input parameter and working on that.
The problem with the iterator is that you would need a cyclic iterator, or starting iterating over and over again.
The reason why you should not remove or add an element from a collection while iterating it is the iterating method might throw a Concurrent exception. But the code here only calls for List.size() which is ok.
Removeing items from a list with 'items.remove((int) position)' is bad in two ways:
What do you think about an iterator on a LinkedList?
I'm curious: How can this work?
Isn't removing items from a list forbidden while you are traversing it?
A ConcurrentModificationException should be thrown, and therefore, you would need to use iterators to be able to remove elements from the list you are traversing.
yep still getting this error