Meta Data#
Difficulty: medium First Attempt: 2025-04-26
- Total time: 10:00.00
Intuition#
Brute-force:
Simply iterate through the conversions
list and count the results.
Approach#
class Solution:
def baseUnitConversions(self, conversions: List[List[int]]) -> List[int]:
n = len(conversions)+1
base = [1]*n
for (start, end, times) in conversions:
base[end] = (base[start]*times)%(10**9 + 7)
return base
Findings#
NA
Encountered Problems#
NA