How can I filter an object to return a new object containing elements with the same values?
For example:
allValues = {"id1": 3, "id2": 4, "id3": 3}
The desired output is:
filteredValues = {"id1": 3, "id3": 3}
This is because the keys "id1" and "id3" have the same value.
The resulting object will only contain 3 keys and values. If no values are shared, an empty object should be returned. Any solutions?