Given a tree in which root is colored black and other remaining nodes are colored red. we can color adjacent node to black and we need to return total ways through which we can color the tree black.
Eg, Input- Total no of nodes in tree, total no of edges
from node array
to node array
4 3
1 1 1
2 3 4
Output - 6