Flatten dict


  • 0
    D
    d = {'a': 'b', 'c' : {'d': 1}} 
    result = {'a': 'b', 'c.d': 1}
    
    d = {'a' {'b': {'c': {'d', 1}}}}
    result = {'a.b.c.d' : 1}
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.