Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def invert_final(d):
- ret = defaultdict(set)
- items = ((key, value) for key in d for value in d[key])
- for key, value in items:
- ret[value].add(key)
- return ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement