unity – I’m failed to understanding array coordinate

I’m totally lost in understanding the arrays’ coordinates. Below is the code I use to generate one dimensional array(10arrays). I attached the console result and the generated result. Please explain why the array(0)(the cube at bottom) does not match the gizmos color? It looks like array(0) actually refer to the 2nd cube(counting from bottom) while array(10) gone missing from the display, the cube(lowest one) looks like an extra generated cube which is irrelevant to the gizmos color.

using UnityEngine;

public class NewBehaviourScript : MonoBehaviour

{
int y;
int() array1 = new int(10);
int temp;
void Start()
{
    
    for (y = 0; y < 10; y++)
        {
            array1( y) = Random.Range(0, 2);

            Debug.Log(string.Format("{0},{1}", y, array1( y)));

        }
}




void OnDrawGizmos()
{
          
        for (y = 0; y < 10; y++)
        {
            Vector2 pos1 = new Vector2(0,  y );
            Gizmos.DrawCube(pos1,new Vector3(0.5f,0.5f,0.5f) );
            Gizmos.color = (array1( y) == 1) ? Color.black : Color.white;
        }
    
}

}

enter image description here

enter image description here