I'm struggling to understand one part from the book "Cracking the coding interview". The author states inserting an element in a dynamic array is $O(1)$ most of the time, except when the array is full and we have to reallocate.
Inserting $X$ elements take $O(2X)$ (because $\frac{X}{1} + \frac{X}{2} + \frac{x}{4} + \ldots + 1 \approx 2 X$)
I perfectly understand until this point but I don't understand second sentence:
"Therefore, $X$ insertions take $O(2X)$ time. The amortized time for each insertion is $O(1)$."
How did she came to this conclusion?