Remove the element at index i
, shift elements after index i
forward, and return the removed element. Asserts the array has at least one item. Invalidates pointers to end of list. This operation is O(N). This preserves item order. Use swapRemove
if order preservation is not important.