Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
expand all and count solution in Clear category for The Tower by tokyoamado
from collections import Counter
from operator import itemgetter
def expand(cube):
quads = [(q * 2)[i:i+4] for i in range(4) for q in
[itemgetter(*p)(cube) for p in [(0, 1, 3, 2), (0, 4, 3, 5), (4, 1, 5, 2)]]]
return quads + [q[::-1] for q in quads]
def tower(cubes):
quads = [q for p in [expand(cube) for cube in cubes] for q in p]
return Counter(quads).most_common(1)[0][1]
April 9, 2019