I have a dictionary and a set. I want to return the key associated with the minimum value if that key is not already in the set without creating a second dictionary used to delete items that are already in the set.
Example: I have dictionary
d = {1:10, 2:20, 3:30, 4:40}
and a set
s = set([1,2])
It should return 3