Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Switch Keys to Values by Tinus_Trotyl
def switch_dict(data: dict) -> dict:
switch = dict()
for key in data:
switch.setdefault(data[key], set())
switch[data[key]] |= {key}
return switch
Oct. 23, 2022
Comments: