Working with multiple gameobjects

I have the requirement to Hide and Show the specific gameobjects on specific button click.

Button-1
gameobject[0].SetActive(false);
gameobject[1].SetActive(false);
gameobject[2].SetActive(false);
gameobject[3].SetActive(true);
gameobject[4].SetActive(false);
gameobject[5].SetActive(false);
gameobject[6].SetActive(false);
gameobject[7].SetActive(true);
gameobject[8].SetActive(true);

Button-2:

gameobject[0].SetActive(true);
gameobject[1].SetActive(false);
gameobject[2].SetActive(false);
gameobject[3].SetActive(false);
gameobject[4].SetActive(false);
gameobject[5].SetActive(false);
gameobject[6].SetActive(false);
gameobject[7].SetActive(true);
gameobject[8].SetActive(false);

Like these, I have some 10 buttons. It seems code is so lengthy and not efficient. Is there any way to optimize this?

Thanks.

Egad man, yes.

Store your objects in a collection.
Somehow associate a button to a specific object.
When any of these buttons is pressed,
Loop over the collection, disabling all objects.
Enable the associated object.

Consider a button which calls a method on the script that holds your collection of objects, passing an index argument.

public GameObject[] myCollection;

public void OnButtonOfNumberClicked( int buttonNumber ) {
  foreach (GameObject go in myCollection) go.SetActive(false);
  myCollection[ buttonNumber ].SetActive( true );
}