So, I already made the task, but there was a little part of it where I don't know was going on. On the first picture, where I declare the newList like this:
The for loop was decrasing the lists size, when a word that contained the letter 'r' was in the scope. So when "rose" came, the loop removed it from the newList array, than it also removed(?) it from the list array. The solution was this:
So my question is why was it decrasing the size for both of the array, and it wasn't decrasing in the solution? I hope my question is understandable.