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

Code 1:
#include<bits/stdc++.h>

using namespace std;


#define vi vector<int>
#define pii pair<int, int>
#define ll long long
#define pb push_back
#define el "\n"
#define all(a) a.begin(), a.end()
#define viin(n, vctr) {vctr.resize(n); for(auto &i : vctr) cin >> i;}
#define vllin(n, vctr) {vctr.resize(n); for(auto &i : vctr) cin >> i;}
#define YES cout << "YES\n"
#define NO cout << "NO\n"
int mod = 1e9 + 7;



// Remove the loop if there is no testcase
void solve(){

	string a, b, c; cin >> a >> b >> c;
	vector<vi> dp(2005, vi(2005, 0));
	int sa = a.size(), sb = b.size();
	for(int i = 1; i <= sb; i++)
		dp[0][i] = dp[0][i - 1] + (c[i - 1] != b[i - 1]);
	for(int i = 1; i <= sa; i++)
		dp[i][0] = dp[i - 1][0] + (c[i - 1] != a[i - 1]);
	for(int i = 1; i <= sa; i++)
		for(int j = 1; j <= sb; j++){
			dp[i][j] = min(dp[i - 1][j] + (c[i + j - 1] != a[i - 1]), dp[i][j - 1] + (c[i + j - 1] != b[j - 1]));
		}

	cout << dp[sa][sb] << el;

}

int main(){
	#ifdef LOCAL
		// accept testcase inputs from file: input
		freopen("input.txt", "r", stdin);
		// output stdout to file: output
		freopen("output.txt", "w", stdout);
		auto begin = chrono::high_resolution_clock::now();
	#else
		// Make cin and cout as fast as stdio
		ios::sync_with_stdio(0);
		cin.tie(0);
	#endif
	
	int tt; cin >> tt; while(tt--)
	solve();
	
	#ifdef LOCAL
		auto end = chrono::high_resolution_clock::now();
		auto elapsed = chrono::duration_cast<chrono::milliseconds> (end - begin);
		cout << el << "Time elapsed: " << (double)elapsed.count() << "ms";
	#endif
	return 0;
}

Code 2:
#include<bits/stdc++.h>

using namespace std;


#define vi vector<int>
#define pii pair<int, int>
#define ll long long
#define pb push_back
#define el "\n"
#define all(a) a.begin(), a.end()
#define viin(n, vctr) {vctr.resize(n); for(auto &i : vctr) cin >> i;}
#define vllin(n, vctr) {vctr.resize(n); for(auto &i : vctr) cin >> i;}
#define YES cout << "YES\n"
#define NO cout << "NO\n"
int mod = 1e9 + 7;



// Remove the loop if there is no testcase
void solve(){

	string a, b, c; cin >> a >> b >> c;
	// vector<vi> dp(2005, vi(2005, 0));
	int dp[2005][2005];
	memset(dp, 0, sizeof dp);
	int sa = a.size(), sb = b.size();
	for(int i = 1; i <= sb; i++)
		dp[0][i] = dp[0][i - 1] + (c[i - 1] != b[i - 1]);
	for(int i = 1; i <= sa; i++)
		dp[i][0] = dp[i - 1][0] + (c[i - 1] != a[i - 1]);
	for(int i = 1; i <= sa; i++)
		for(int j = 1; j <= sb; j++){
			dp[i][j] = min(dp[i - 1][j] + (c[i + j - 1] != a[i - 1]), dp[i][j - 1] + (c[i + j - 1] != b[j - 1]));
		}

	cout << dp[sa][sb] << el;

}

int main(){
	#ifdef LOCAL
		// accept testcase inputs from file: input
		freopen("input.txt", "r", stdin);
		// output stdout to file: output
		freopen("output.txt", "w", stdout);
		auto begin = chrono::high_resolution_clock::now();
	#else
		// Make cin and cout as fast as stdio
		ios::sync_with_stdio(0);
		cin.tie(0);
	#endif
	
	int tt; cin >> tt; while(tt--)
	solve();
	
	#ifdef LOCAL
		auto end = chrono::high_resolution_clock::now();
		auto elapsed = chrono::duration_cast<chrono::milliseconds> (end - begin);
		cout << el << "Time elapsed: " << (double)elapsed.count() << "ms";
	#endif
	return 0;
}

Answer: 2