Minimum Cost To Make Two Strings Identical

easy
1. You are given 2 strings (str1 and str2) and the cost of removing a character from the respective strings is x and y
 2. Your task is to make the two strings identical by deleting characters in them, if need be
 3. Find and return minimum cost to make the two given strings identical
 4. Input and output is handled for you
 5. It is a functional problem ,please do not modify main()

Input Format

Input is handled for you

Output Format

Output is handled for you

Constraints

1<=str1.lentgh, str2.lentgh<=1000
 1<= cost x, y<=1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
12 15
qpqrsb lpqrs
Output
39
Previous
Minimum Cost For Tickets
Next
Maximum Non-overlapping Bridges

Related Questions