Leetcode 2977. Minimum Cost to Convert String II
Given source and target strings and a list of allowed substring → substring replacement rules with costs, compute the minimum total cost to transform source into target by applying any number of operations where each operation uses a listed rule and operations must be either on disjoint intervals or exactly the same interval (i.e., no partial overlaps). Return -1 if the transformation is impossible.
Asked at:
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Late February, 2026
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.