Leetcode 3213. Construct String with Minimum Cost
Given a target string and a list of words with costs, repeatedly append any word to an initially empty string (paying its cost) to exactly build the target and return the minimum total cost or -1 if impossible. The core challenge is computing the minimum cost to reach each target prefix (a DP/shortest-path over prefixes, with efficient word matching required for large inputs).
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.