You are given a string target, an array of strings words, and an integer array costs of the same length, where costs[i] represents the cost of using the string words[i].
Starting with an empty string, you can repeatedly append any string from words. Appending words[i] adds costs[i] to the total cost. You may select each string from words any number of times.
Return the minimum total cost required to construct target. If it is impossible to form target, return
Constraints:
target.length
words.length = costs.length
words[i].length target.length
target and words[i] consist only of lowercase English letters.
costs[i]
You are given a string target, an array of strings words, and an integer array costs of the same length, where costs[i] represents the cost of using the string words[i].
Starting with an empty string, you can repeatedly append any string from words. Appending words[i] adds costs[i] to the total cost. You may select each string from words any number of times.
Return the minimum total cost required to construct target. If it is impossible to form target, return
Constraints:
target.length
words.length = costs.length
words[i].length target.length
target and words[i] consist only of lowercase English letters.
costs[i]