diff --git a/strings/minimum operation to convert one string to another string.md b/strings/minimum operation to convert one string to another string.md new file mode 100644 index 0000000..567285a --- /dev/null +++ b/strings/minimum operation to convert one string to another string.md @@ -0,0 +1,42 @@ +### QUESTION + + Given two strings s1,s2 , convert s1 to s2; + operations: + 1. change any character from a to b or b to a + 2. any two characters can be swapped with cost |i-j| + +## Code in CPP +```.cpp + +#include +using namespace std; +int main(){ + string s1,s2; + cin>>s1>>s2; + + int cost=0; + for(int i=0;i