Checking the validity of a pyramid of dominoes
I can think of a brute force solution. Try all 6!*(2^6) options. i.e. create all legal permutations of the pyramid and test each one if it holds the condition. It will take around 50K iterations to do.