Edit Distance Problem can be solved by dynamic programming but why won't my solution work?

edist
spoj

#1

#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t–){
string s1,s2;
cin>>s1>>s2;
int len1=s1.length(),len2=s2.length();
long long count=0;
if(len1<=len2){
for(int i=0;i<len1;i++){
if(s1*==s2*)
continue;
else
count++;
}
count +=len2-len1;
cout<<count<<"
";
}
else{
for(int i=0;i<len2;i++){
if(s1*==s2*)
continue;

		else 
			count++;
	}
	count +=len1-len2;
	cout<<count<<"

";
}
}
return 0;
}


link to the problem


#2

Your code fails in this testcase:
1

sunday

saturday

Your code gives 7 as output but expected output is 3. Last three and first characters are same. We basically
need to convert “un” to “atur”. This can be done using
below three operations.
Replace ‘n’ with ‘r’, insert t, insert a