Computer Science, asked by ektapardhi74701, 10 months ago

Given two strings find the minimum cost to make two strings equal using deletions

Answers

Answered by exmirul1101
0

Answer:Input :  X = "abcd", Y = "acdb", costX = 10, costY = 20.

Output:  30

For Making both strings identical we have to delete  

character 'b' from both the string, hence cost will

be = 10 + 20 = 30.

Input :  X = "ef", Y = "gh", costX = 10, costY = 20.

Output:  60

For making both strings identical, we have to delete 2-2

characters from both the strings, hence cost will be =

10 + 10 + 20 + 20 = 60.

Explanation:

Answered by Anonymous
0

Explanation:

We need to find minimum cost required to make the given two strings identical. We can delete characters from both the strings. The cost of deleting a character from string X is costX and from Y is costY. Cost of removing all characters from a string is same.

Similar questions