def isValidState(cubes):
        """ ensure the rule: four different colors on each side """
        frontColors  = set()
        backColors   = set()
        topColors    = set()
        bottomColors = set()

        for cube in cubes:
            frontColors.add(cube.front)
            backColors.add(cube.back)
            topColors.add(cube.top)
            bottomColors.add(cube.bottom)

        return  len(frontColors)  == Color.MAX \
            and len(backColors)   == Color.MAX \
            and len(topColors)    == Color.MAX \
            and len(bottomColors) == Color.MAX
 ensure the rule: four different colors on each side 
recipes/Python/578454_Puzzle_Four_cubes_different_colors_their/recipe-578454.py