The problem was that we did not handle the case correctly when doubling the array was not enough. We need to keep doubling until everything fits in.
The problem was that we did not handle the case correctly when doubling the array was not enough. We need to keep doubling until everything fits in.