Advent of Code 2020 – Day 17 – Mashup

Elf standing among cubes thinking "Now I want a pickaxe."

Today’s puzzle I understood what to do but could not figure an easy way to do it. I figured something like numpy could do, but I don’t know numpy. So today was a day used to learn about itertools.