Starting from a child node, work backwards, removing it and ancestors that have no value
If child is an only child, it will recursively call the same function on the parent.
child
Child to start from
Starting from a child node, work backwards, removing it and ancestors that have no value
If
childis an only child, it will recursively call the same function on the parent.