Swap element with last element so that removal from the list can be done in O ( 1 ) time
size = len ( self . arr ) NEW_LINE last = self . arr [ size - 1 ] NEW_LINE self . arr [ index ] , self . arr [ size - 1 ] = self . arr [ size - 1 ] , self . arr [ index ] NEW_LINE