Are you sure they ask you to use arrays, and not vectors for this?
The only way you can insert into a array is by knowing the maximum possible size during compile time and when inserting you move everything at that index and above by 1, then write the value.
If it has to be be arrays then that's the only way unless you are allowed to create a dynamically allocated array.