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

#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[i]==s2[i])
continue;
else
count++;
}
count +=len2-len1;
cout<<count<<"\n";
}
else{
for(int i=0;i<len2;i++){
if(s1[i]==s2[i])
continue;

		else 
			count++;
	}
	count +=len1-len2;
	cout<<count<<"\n";
	}
}
return 0;
    }

link to the problem

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

//