I have a nested dictionary which looks like:
{
A:{I:{key1:value1,key2:value2},
II:{key1:value2, key2:value5, key3:value6}},
B:{I:{key1:value1,key2:value2},
III:{key1:value2, key2:value5, key3:value6}
IV:{key1:value9, key2:value7, key3:value8}},
C:{V:{key1:value11,key2:value22},
VI:{key1:value12, key2:value15, key3:value16}
VII:{key1:value19, key2:value17, key3:value18}}
}
My objective is to retrieve the keys ( A,B,C and I,II,III,IV,V,VI,VII) for the occurences of a value. So for example, if I am querying the dictionary for "value2", I should get the result as
{A:[I,II],B:[I,III]}
What is the most efficient way to do this query?