3253. Construct String with Minimum Cost (Easy)
Hints
Hint 1
Let
dp[i] denote the minimum cost to make s equal to the prefix of target of length i.Hint 2
dp[i] = min(costs[k] + dp[j]), where j > i and words[k] == target[i..j].Preparing judge…