Problem: 2050E - Three Strings
Language: Java 21

Previous submission (verdict: Time limit exceeded on test 6):
//package codeforcesques;
import java.util.*;
import java.io.*;
public class ThreeStrings {
    int mincount=Integer.MAX_VALUE;
    public static void main(String[] args) {
        FastReader fs=new FastReader();

        int t=fs.nextInt();

        while(t-->0)
        {
            String s1=fs.nextLine();
            String s2=fs.nextLine();
            String s3=fs.nextLine();
            ThreeStrings d=new ThreeStrings();
           d.count(s1,s2,s3,0,0,"");
           System.out.println(d.mincount);

        }
    }
    public void count(String s1,String s2,String s3,int i1,int i2,String store)
    {
        int n1=s1.length();
        int n2=s2.length();
        if(i1>=n1 || i2>=n2)
        {
            int cnt1=0,cnt2=0;
            String temp=store;
            for(int i=i1;i<n1;i++)
                store+=s1.charAt(i);
            for(int i=i2;i<n2;i++)
                store+=s2.charAt(i);
            for(int i=i1;i<n1;i++)
                temp+=s1.charAt(i);
            for(int i=i2;i<n2;i++)
                temp+=s2.charAt(i);
            for(int i=0;i<s3.length();i++)
            {
                if(s3.charAt(i)!=temp.charAt(i))
                    cnt2++;
                if(s3.charAt(i)!=store.charAt(i))
                    cnt1++;
                continue;
            }
            mincount=Math.min(mincount,Math.min(cnt1,cnt2));
            return ;
        }
        else{
            String temp=store;
            store+=s1.charAt(i1);
            count(s1,s2,s3,i1+1,i2,store);
            temp+=s2.charAt(i2);
            count(s1,s2,s3,i1,i2+1,temp);
        }
    }
}
class FastReader {
    BufferedReader gt;
    StringTokenizer st;

    public FastReader() {
        gt = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(gt.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    String nextLine() {
        String str = "";
        try {
            str = gt.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    int[] readIntArray(int n) {
        int[] res = new int[n];
        for (int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    long[] readLongArray(int n) {
        long[] res = new long[n];
        for (int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }

    String[] readStringArray(int n) {
        String[] str = new String[n];
        for (int i = 0; i < n; i++)
            str[i] = nextLine();

        return str;
    }
    int getGCD(int a,int b)
    {
        if(b==0)
            return a;
        else
            return getGCD(b,a%b);
    }
}

Submission (verdict: Compilation error):
//package codeforcesques;
import codeforcesques.AbsoluteSorting;

import java.util.*;
import java.io.*;
public class ThreeStrings {
    int mincount=Integer.MAX_VALUE;
    public static void main(String[] args) {
        FastReader fs=new FastReader();

        int t=fs.nextInt();

        while(t-->0)
        {
            String s1=fs.nextLine();
            String s2=fs.nextLine();
            String s3=fs.nextLine();
            ThreeStrings d=new ThreeStrings();
            int [][]dp=new int[s1.length()][s2.length()];
            for(int i=0;i<s1.length();i++)
            {
                Arrays.fill(dp[i],-1);
            }
           d.rec(0,0,0,s1,s2,s3,dp);
           System.out.println(d.mincount);

        }
    }
    public static int rec(int n, int i, int j, String a, String b, String c, int[][] dp){
        if(i==a.length()){
            int val = 0;
            while(j<b.length()){
                if(b.charAt(j)==c.charAt(n)){
                    val++;
                }
                j++;
                n++;
            }
            return val;
        }
        if(j==b.length()){
            int val = 0;
            while(i<a.length()){
                if(a.charAt(i)==c.charAt(n)){
                    val++;
                }
                i++;
                n++;
            }
            return val;
        }
        if(dp[i][j]!=-1){
            return dp[i][j];
        }
        int c1 = 0;
        int c2 = 0;
        if(a.charAt(i)==c.charAt(n)){
            c1++;
        }
        if(b.charAt(j)==c.charAt(n)){
            c2++;
        }
        int max1 = rec(n+1,i+1,j,a,b,c,dp)+c1;
        int max2 = rec(n+1,i,j+1,a,b,c,dp)+c2;
        dp[i][j] = Math.max(max1, max2);
        return dp[i][j];
    }
class FastReader {
    BufferedReader gt;
    StringTokenizer st;

    public FastReader() {
        gt = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(gt.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    String nextLine() {
        String str = "";
        try {
            str = gt.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    int[] readIntArray(int n) {
        int[] res = new int[n];
        for (int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    long[] readLongArray(int n) {
        long[] res = new long[n];
        for (int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }

    String[] readStringArray(int n) {
        String[] str = new String[n];
        for (int i = 0; i < n; i++)
            str[i] = nextLine();

        return str;
    }
    int getGCD(int a,int b)
    {
        if(b==0)
            return a;
        else
            return getGCD(b,a%b);
    }
}