Alternative to Circular Array?

The Tower description sounds like you are looking for a data structure called Queue or FIFO (as @jb4x already pointed out). Try LinkedList or ArrayDeque which implement Queue: they have poll() to remove elements form the front and offer(e) to insert elements to the back.

Another idea would be to have two arrays. Read numbers from one array from first to last. Write new numbers into the second array as needed. When you read all the way to the end of the first array, clear it and swap the arrays. Read array becomes write array and write array becomes read array.

Basically: process one array into another array, swap arrays, repeat.

This will be much easier if your “arrays” are a bit clever: you can use either ArrayList<Integer> + add(), or IntList + append() (which might be faster because working with Integers has some overhead).

2 Likes