https://codeforces.com/problemset/problem/1005/B
My Answer Code:
/*
Author:Albert Tesla Wizard
Time:2021/4/7 17:22
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
string s1,s2;
cin>>s1>>s2;
int len1=s1.length();
int len2=s2.length();
int cnt=0;
int i=len1-1,j=len2-1,k=min(len1,len2);
while(k--)
{
if(s1[i]!=s2[j])break;
else {cnt++;i--;j--;}
}
cout<<len1+len2-2*cnt<<'\n';
return 0;
}