Consider a 5×5 array. In how many ways can we fill the array with X-s and O-s so that no two consecutive rows are identical?
So first one we can do $2^5$ ways. Second row in $2^5-1$, the same as 3,4,5 rows.
So final answer is $2^5*(2^5-1)^4$
Is it correct way of thinking?