You are given two integer arrays skill and mana. There are n wizards arranged in a fixed order, where wizard i has skill value skill[i], and there are m potions to brew in order, where potion j has mana requirement mana[j].
Brewing a single potion must be done by all wizards sequentially from wizard i works on potion j, it takes skill[i] * mana[j] units of time.
Each wizard can work on at most one potion at a time, and each potion can be worked on by at most one wizard at a time. A potion must move from wizard i to wizard i + 1 immediately after wizard i finishes, meaning the start times must be chosen so that no potion ever waits between wizards.
Return the minimum possible time at which all m potions have finished brewing (after wizard
Constraints:
n == skill.length
m == mana.length
You are given two integer arrays skill and mana. There are n wizards arranged in a fixed order, where wizard i has skill value skill[i], and there are m potions to brew in order, where potion j has mana requirement mana[j].
Brewing a single potion must be done by all wizards sequentially from wizard i works on potion j, it takes skill[i] * mana[j] units of time.
Each wizard can work on at most one potion at a time, and each potion can be worked on by at most one wizard at a time. A potion must move from wizard i to wizard i + 1 immediately after wizard i finishes, meaning the start times must be chosen so that no potion ever waits between wizards.
Return the minimum possible time at which all m potions have finished brewing (after wizard
Constraints:
n == skill.length
m == mana.length