Skip to content

Swap with last for constant-time deletion [mp]

Micro pattern

Description

Replace a removed array element with the last element, update its index, and pop.

Problems