Meta Interview Question

Hard problem related to recursion on a tree