Problem: 2050E - Three Strings
Language: c++20 

Code 1:
#include <bits/stdc++.h>
using namespace std;
#define int long long
int power(int A, int expo)
{
    if (expo == 0)
        return 1;
    int res = power(A, expo / 2);
    if (expo % 2)
        return res * res * A;
    else
        return res * res;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int fact(int x)
{
    if (x == 1 || x == 0)
        return 1;
    return (x * fact(x - 1));
}
class UnionFind{
    private: vector<int> parent,rank;
    public:
        UnionFind(int n){
            rank.assign(n,0);
            parent.assign(n,0);
            iota(parent.begin(),parent.end(),0);
        }
        int find(int x) {
            if(parent[x] == x)
                return x;
            
            return parent[x] = find(parent[x]);
        }

    void UnionSet(int x, int y) {
        int x_parent = find(x);
        int y_parent = find(y);

        if(rank[x_parent] > rank[y_parent]) {
            parent[y_parent] = x_parent;
        } else if(rank[x_parent] < rank[y_parent]) {
            parent[x_parent] = y_parent;
        } else {
            parent[x_parent] = y_parent;
            rank[y_parent]++;
        }
    }
};

int lcm(int a, int b) {
    return (a / gcd(a, b)) * b;
}
void solve() {
   string a,b,c;
    cin>>a>>b>>c;
    int n = a.size();
    int m = b.size();

    vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            if (i == 0 && j == 0) {
                dp[i][j] = 0;
            } else if (i == 0) {
                dp[i][j] = dp[i][j - 1] + (b[j - 1] != c[i + j - 1]);
            } else if (j == 0) {
                dp[i][j] = dp[i - 1][j] + (a[i - 1] != c[i + j - 1]);
            } else {
                dp[i][j] = min(
                    dp[i - 1][j] + (a[i - 1] != c[i + j - 1]),
                    dp[i][j - 1] + (b[j - 1] != c[i + j - 1]) 
                );
            }
        }
    }

    cout << dp[n][m] << endl;
}


signed main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
#define int long long
int power(int A, int expo)
{
    if (expo == 0)
        return 1;
    int res = power(A, expo / 2);
    if (expo % 2)
        return res * res * A;
    else
        return res * res;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int fact(int x)
{
    if (x == 1 || x == 0)
        return 1;
    return (x * fact(x - 1));
}
class UnionFind{
    private: vector<int> parent,rank;
    public:
        UnionFind(int n){
            rank.assign(n,0);
            parent.assign(n,0);
            iota(parent.begin(),parent.end(),0);
        }
        int find(int x) {
            if(parent[x] == x)
                return x;
            
            return parent[x] = find(parent[x]);
        }

    void UnionSet(int x, int y) {
        int x_parent = find(x);
        int y_parent = find(y);

        if(rank[x_parent] > rank[y_parent]) {
            parent[y_parent] = x_parent;
        } else if(rank[x_parent] < rank[y_parent]) {
            parent[x_parent] = y_parent;
        } else {
            parent[x_parent] = y_parent;
            rank[y_parent]++;
        }
    }
};

int lcm(int a, int b) {
    return (a / gcd(a, b)) * b;
}
int dp[10001][10001];
int solveRec(int i, int j,string &a, string &b, string &c) {
    if (i == a.size() && j == b.size()) return 0;
    if (dp[i][j] != -1) return dp[i][j];

    int k = i + j;
    int result = INT_MAX;

    if (i < a.size()) {
        result = min(result, solveRec(i + 1, j, a, b, c) + (a[i] != c[k]));
    }

    if (j < b.size()) {
        result = min(result, solveRec(i, j + 1, a, b, c) + (b[j] != c[k]));
    }

    return dp[i][j] = result;
}
void solve() {
   string a,b,c;
   cin>>a>>b>>c;
   memset(dp,-1,sizeof(dp));
   cout<<solveRec(0,0,a,b,c)<<'\n';
}


signed main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Answer: 1