Arrays easy time O(n) space O(1)
Delete from an Array
Removing position p leaves a hole; every element after p shifts one place left to close it. That shifting is the O(n) cost.
Delete the element at index 2 — the value 15.
1 / 5
Practice
Machine twin: /dsa-viz-v2/array-delete.json — the full deterministic run as structured data.