Given an unrooted tree, in each operation, pick the maximum leaf node, color it green. Then, delete any other leaf except this one. Continue till you have only 1 remaining.
- For each vertex, find out if there is a configuration in which it can be colored green.
- Find the number of unique sets of green vertices.
I created a video on this problem that requires taking tree DP contributions not just from children or parent, but also from nodes far apart in other subtrees.







