Turn a flat dotted-key dictionary back into a nested structured dictionary.
Constraints
Example
>>> unflatten({'a.b.c': 1, 'a.b.d': 2, 'e': 3})
{'a': {'b': {'c': 1, 'd': 2}}, 'e': 3}
>>> unflatten({'x': 10})
{'x': 10}
>>> unflatten({'a.b': {'k': 1}, 'a.c': [1,2]})
{'a': {'b': {'k': 1}, 'c': [1,2]}}
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints