Untitled

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
568 B
2
Indexable
Never
#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);


    string str1;
    string str2;

    cin >> str1 >> str2;

    long long number = 0;

    long long i = str1.length()-1;
    long long j = str2.length()-1;

        while(i>=0 && j>=0){

            if(str1[i]!=str2[j]){
                break;
            }

            number++;
            i--;
            j--;
        }

    cout << (str1.length()-number) + (str2.length()-number) << endl;

    return 0;
}