Could somebody guide me in the right direction with this please, I don't understand how to return the results from leaf to root
tree = {
"name": "root",
"children": [
{
"name": "child1",
"children": [
{
"name": "grand_child1",
"children": []
},
{
"name": "grand_child2",
"children": []
}
]
},
{
"name": "child2",
"children": []
}
]
}
EDIT: The solution should be an algorithm, in that if tree depth is increased it should still work