Search⌘ K
AI Features

Solution: Find the Minimum Amount of Time to Brew Potions

C# solution for the Find the Minimum Amount of Time to Brew Potions problem using the Dynamic Programming pattern.

Statement

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 00 to wizard n1n - 1. If wizard i works on potion j ...