I have a dict like:
example = {'a':2, 'b':2, 'c':1, 'd':1}
I want to keep only the maximum values and keys. The output should be:
{'a':2, 'b':2}
This is different from just getting the maximum value, as has been asked in other places. What is the best way to do this?