I have a dict of dicts that represents a tree:
{1: {2: 3, 4: 5}, 6: {7: 8, 9: 10}}
How can I turn it into all possible paths from the root to its leaves?
The otput should be smt like this:
[[1,2,3],[1,4,5],[6,7,8],[6,9,10]]
Is there some kind of Python dict comprehension moneliner that can solve this problem for any dict depth?