filmov
tv
Minimum Cost to Convert String I - Leetcode 2976 - Java

Показать описание
Problem Description
Given two strings, source and target, both of the same length, made up of lowercase letters, and two arrays original and changed, and an array cost which tells the cost of conversion between original and changed,
write a program to return the minimum cost needed to change source into target using any number of operations. If it's not possible to convert source to target, return -1.
Given two strings, source and target, both of the same length, made up of lowercase letters, and two arrays original and changed, and an array cost which tells the cost of conversion between original and changed,
write a program to return the minimum cost needed to change source into target using any number of operations. If it's not possible to convert source to target, return -1.