Pattern: Rows with all three cells the same become rows of 5s; all other rows become rows of 0s. Strategy: For each row, if row[0] == row[1] == row[2], output [5,5,5] else [0,0,0].
row[0] == row[1] == row[2]
[5,5,5]
[0,0,0]