Looping back to the start of arrays

Let’s say that I have two groups (both arrays). Group 1 is empty and awaiting values. Group 2 contains the values.

While I am able to pass the values from group 2 to group 1. I am getting stuck when I need to put say group2 [4] into group1 [0] and then have the second array loop around to the start when it has run out of entries but group1 still has empty spots so they end up like below:
Group1 [0] = Group2 [4]
Group1 [1] = Group2 [5]
Group1 [2] = Group2 [0]
Group1 [3] = Group2 [1]
Group1 [4] = Group2 [2]
Group1 [5] = Group2 [3]

How might the code for this look?

Is this what you need? You can use one index to loop through the biggest array and then reset the index of the shorter array every time it is about to overrun the shorter array

int[] array1 = new int[3] { 9, 3, 8 };
int[] array2 = new int[5] { 8, 7, 3, 9, 5 };

for (int indexArray2 = 0, indexArray1 = 0; indexArray2 < array2.Length; ++indexArray2, ++indexArray1)
        {
            if (indexArray1 == array1.Length)
            {
                indexArray1 = 0;
            }

            array2[indexArray2] = array1[indexArray1];
        }