Project Euler 79 - Passcode derivation

Official link: https://projecteuler.net/problem=79

Thought Process

I originally solved this problem like so:


But I wasn't happy when I came back to it using the itertools module and came up with a much nicer and faster solution

I will let you figure out how you want to remove the elements so that this all works with a single run line, of course you could just do it by hand now Hint: (del mydict[x] deletes key x for a dictionary, set.remove(x) deletes element x for a set, mydict[x].remove(y) deletes element y for a the set = mydict[x])

Update: I got an email from Martin Ueding where he said my blog helped him solve the problem, on his own blogpost about the problem he provides great illustrations of what is going on, and he also provides much more succinct code, and most importantly he shows why the assumption of unique digit is essential with my method.

Interactive Code

No interactive code, both methods are shown below