Your solution will run a lot faster if you change one line (allowing hashed membership tests):
subset = set(word for word in valid if len(word)==n)
...although at that point there's not much benefit in filtering on word length. You might as well construct a set of the entire valid list and check membership against that.