Problem Description
In one operation you can set some A[x] equal to B[x], this cost 1 coin.
You can also Reverse a substring A[i...j] atmost once. this cost C coins.
Find minimum operation required to make both string equal.
A = "abceda", B = "bdecbo", C = 1
Input 2:
A = "finger", B = "ginger", C = 0
3
Output 2:
1
Initially we have, A = "abceda"
set A[0] = B[0], A = "bbceda"
set A[5] = B[5], A = "bbcedo"
reverse (1,4), A = "bdecbo"
Explanation 2:
set A[0] = B[0]
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.