Close the gap
Removing the final item is cheap. Removing elsewhere copies every later item left.
Take the next step
Adding and removing from the middle has a cost: values must move to keep the buffer compact.
Purpose: understand why searching, inserting, and removing in the middle of an array require extra work to keep values contiguous.
TRY AN OPERATION
Both middle operations can require shifting several values. That is why they are O(n).
The important distinction
pop(i) removes by index and closes the gap by shifting later values left. insert(i, x) does the inverse: it shifts values right to make room.
contains(x) searches one value at a time. remove(x) finds the first match, then calls pop on its index.
Removing the final item is cheap. Removing elsewhere copies every later item left.
Shift values right from the insertion point, then write the new value.
Search for the first matching value, then remove it using its index.