Looks like you are running a for loop on an array and changing the size of the array within the loop itself. That causes an error because the for loop doesn’t know anymore how many elements it has to loop over.
Looks like you are running a for loop on an array and changing the size of the array within the loop itself. That causes an error because the for loop doesn’t know anymore how many elements it has to loop over.