Elbit Systems interview question

Write a function that resets, inserts, and returns values ​​to the array according to run times requested by the interviewer