Rosetta Problems

Number of Ways to Assign Edge Weights I

https://leetcode.com/problems/number-of-ways-to-assign-edge-weights-i