simple prefix and suffix
\njava\nclass Solution {\n    public int minimumScore(String s, String t) {\n        int[] pre = new int[s.length()];\n        for(int i=0, j=0; i<s.length() &&
\n```java\nclass Solution {\n    public int minimumScore(String s, String t) {\n        int[] pre = new int[s.length()];\n        for(int i=0, j=0; i<s.length() && j<t.length(); i++){\n            if(i>0) pre[i] = pre[i-1];\n            if(s.charAt(i) == t.charAt(j)){\n                j++; pre[i]++;\n            }\n        }\n        int c=0,ans = 0;\n        for(int i=s.length()-1, j=t.length()-1; i>=0 && j>=0; i--){\n            ans = Math.max(ans, c+pre[i]);\n            if(s.charAt(i) == t.charAt(j)){\n                j--; c++;\n            }\n        }\n        ans = Math.max(ans, c);\n        return Math.max(0, t.length()-ans);\n    }\n}\n```
['Java']