Undirected tree rooted at node 1. Assign each edge weight 1 or 2. Find the number of ways to assign weights on the path from root to a deepest node such that the path cost is odd.
Tree has 2 nodes, 1 edges. Root = 1. We need the max depth from root.
Single DFS for max depth. Then O(log d) for modular exponentiation.