Leetcode 3528. Unit Conversion I
Given n units and n-1 directed conversion edges that guarantee a unique path from unit 0 to every other unit, compute for each unit the product of conversion factors along the path from 0 to that unit, returning each product modulo 10^9+7 — essentially a tree traversal that accumulates multiplicative weights.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.