Cell Compete

There is a colony of 8 cells arranged in a straight line where each day every cell competes with its adjacent cells (neighbour). Each day, for each cell, if its neighbours are both active and both inactive, the cell becomes inactive the next day, otherwise it becomes active the next day.
Assumptions: The two cells on the ends have single adjacent cell, so the other adjacent cell can be assumed to be always inactive.
Even after updating the cell state. Consider its previous state for updating the state of other cells. Update the cell information of all cells simultaneously.
Write a function cell Compete which takes one 8 element array of integer's cells representing the current state of 8 cells and one integer days representing the number of days to simulate.
An integer value of 1 represents an active cell and value of 0 represents an inactive cell.

Sample Input1:
1 0 0 0 0 1 0 0
1
Sample Output1:
0 1 0 0 1 0 1 0
Sample Input2:
1 1 1 0 1 1 1 1
2
Sample Output2:
0 0 0 0 0 1 1 0