I have a dict like this:
{
1: {
3: {
1: {c:32},
2: {c:12}
},
4: {c: 66}
},
2: {
3: {c: 1},
5: {c: 2}
}
}
How can I elegantly unroll this tree to get:
[
[1, 3, 1, 32],
[1, 3, 2, 12],
[1, 4, 66],
[2, 3, 1],
[2, 5, 2]
]
This structure can be arbitrarily deep.
EDIT - I don't care about the order of the output. 'c' is a count of the times a particular sequence of integer was seen. So in this case, [1, 3, 1] was seen 32 times.
The exact format isn't so important, it's the technique I am after.