john hog wrote:it just seems to be moving over each item by one because you are removing the very first item.
Yeah, that's pretty close. Just a couple of minor complaints:
1. No items are actually being "removed" from anything. What's happening in the inner loop is that it doesn't start at the beginning of the array.
2. You've noticed that the inner loop doesn't start at the beginning of the array, despite my first complaint. It does indeed skip over the first items. But not just the "very first item" -- have a look at the starting point of the inner loop again to see what it actually skips over.