Faced with this question during job interview and wondering what is the solution.
for blues, you will take
sum of blues with their right locations, two blues + one blue becomes three blues with right locations.
for other colors,
you will take the different resulting as green. for first one two green one red results 1 green, for the other one three green two red becomes one green and so on.