Simple Binary Search Approach
\n\n#define ll long long\nclass Solution {\npublic:\n    int check(vector<int>& p,vector<int>& s,int m){\n        int l=0,n=p.size()-1;\n        for(int r=0;r<n
\n```\n#define ll long long\nclass Solution {\npublic:\n    int check(vector<int>& p,vector<int>& s,int m){\n        int l=0,n=p.size()-1;\n        for(int r=0;r<n;r++){\n            while((r-l+1)>m)\n                l++;\n            if((r-l+1)==m){\n                int left=-1;\n                if(l)\n                    left=p[l-1];\n                int right=s[r+1];\n                if(left<right)\n                    return 1;\n            }\n        }\n        \n        return 0;\n    }\n    \n    int minimumScore(string s, string t) {\n        int n=s.length(),m=t.length();\n        vector<int> pr(m+1,n),sf(m+1,-1);\n        sf[m]=n;\n        \n        int i=0,j=0;\n        \n        while(i<n and j<m){\n            if(s[i]==t[j]){\n                pr[j]=i;\n                j++;\n            }\n            i++;\n        }\n        \n        i=n-1;\n        j=m-1;\n        \n        while(i>=0 and j>=0){\n            if(s[i]==t[j]){\n                sf[j]=i;\n                --j;\n            }\n            --i;\n        }\n        \n        \n        \n        ll l=0,ans=m,r=m;\n        \n        while(l<=r){\n            ll mid=l+((r-l)>>1);\n            \n            if(check(pr,sf,mid)){\n                ans=mid;\n                r=mid-1;\n            }\n            else\n                l=mid+1;\n        }\n        \n        \n        return ans;\n    }\n};\n```
['C', 'Binary Tree', 'C++']