Java Solution using Binary Search
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minimumScore(String s, String t) {\n        int n=s.length(); int m=t.length();\n        ArrayList<Integer> list = new ArrayList<>();\n        int sIdx=n-1;\n        for(int i=m-1; i>=0; i--){\n            while(sIdx>=0 && s.charAt(sIdx)!=t.charAt(i)) sIdx--;\n            if(sIdx==-1) break;\n            list.add(sIdx);\n            sIdx--;\n        }\n        Collections.reverse(list);\n        int ans = m-list.size();\n        if(ans==0) return 0;\n        \n        sIdx=0;\n        for(int i=0; i<m; i++){\n            while(sIdx<n && s.charAt(sIdx)!=t.charAt(i)) sIdx++;            \n            int idx = upperBound(list,sIdx);            \n            if(idx==list.size()){\n                if(sIdx==n) break;\n                ans=Math.min(ans,m-i-1);\n                sIdx++;\n                continue;\n            }\n            int lastIncluded = list.size()-idx;\n            ans = Math.min(ans,m-lastIncluded-i-1);\n            sIdx++;\n        }\n        return ans;        \n    }\n\n    int upperBound(ArrayList<Integer> list, int val){\n        int low=0; int high=list.size()-1;\n        int ans=list.size();\n        while(low<=high){\n            int mid=(low+high)/2;\n            if(list.get(mid)>val){\n                ans=mid;\n                high=mid-1;\n            }else low=mid+1;     \n        }\n        return ans;\n    }\n}\n\n\n// "abecdebe"\n// "eaebceae"\n```
['String', 'Binary Search', 'Java']