Minimum Cost To Make Two Strings Identical

1. You are given two strings S1, S2, and two numbers x and y.
2. The cost of deleting a character from S1 is x and the cost of deleting a character from S2 is y.
3. You can delete characters from both the strings.
4. You have to find the minimum cost required to make the given two strings identical.
Input Format
Two Strings S1, S2
Two numbers x and y
Output Format
A number representing the minimum cost of making the given two strings identical.
Question Video
Constraints
1 <= length of strings S1 and S2 <= 1000
1 <= x,y <= 1000
Sample Input
sea
eat
10
7
Sample Output
17


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name