Feb-05-2018, 01:23 PM
It is worse because you store all the paths, which you don't need to do. That's why I told you to remove set() and list(). The call to
itertools.permutations()
generates all the paths, but it doesn't store them.