Construct String with Minimum Cost (Easy)
Fill a prefix-cost table left to right: each word that matches at a reachable position offers a cheaper route to a longer prefix.
Fill a prefix-cost table left to right: each word that matches at a reachable position offers a cheaper route to a longer prefix.