TP 11 exo1: simplify the logic in the array creation and resizing