✅Two Pointer+Binary Search+Prefix/suffix Easy Solution✅
\n\n# Code\n\nclass Solution {\npublic:\n    int find(int leftid, int left, vector<int>& suff) {\n        int n = suff.size();\n        int i = leftid, j = n - 
\n\n# Code\n```\nclass Solution {\npublic:\n    int find(int leftid, int left, vector<int>& suff) {\n        int n = suff.size();\n        int i = leftid, j = n - 1, ans = -1;\n        while (i <= j) {\n            int mid = (i + j) / 2;\n            if (suff[mid] > left) {\n                ans = mid;\n                j = mid - 1;\n            } else {\n                i = mid + 1;\n            }\n        }\n        return ans;\n    }\n    int minimumScore(string s, string t) {\n        int n = s.size(), m = t.size();\n        vector<int> pre(m, -1), suff(m, -1);\n        int i = 0, j = 0;\n        while (i < n && j < m) {\n            if (s[i] == t[j]) {\n                pre[j] = i;\n                j++;\n            }\n            i++;\n        }\n        i = n - 1, j = m - 1;\n        while (i >= 0 && j >= 0) {\n            if (s[i] == t[j]) {\n                suff[j] = i;\n                j--;\n            }\n            i--;\n        }\n\n        int mini = m;\n        for (int i = 0; i < m; i++) {\n            if (pre[i] != -1) {\n                int right = find(i + 1, pre[i], suff);\n                if (right != -1) {\n                    mini = min(mini, right - i - 1);\n                }\n            } else {\n                mini = min(mini, m - i);\n                break;\n            }\n        }\n        for (int i = m - 1; i >= 0; i--) {\n            if (suff[i] == -1) {\n                mini = min(mini, i + 1);\n                break;\n            }\n        }\n        if (m == 1 && pre[0] != -1) {\n            mini = min(mini, 0);\n        }\n        return mini;\n    }\n};\n```
['Two Pointers', 'String', 'Binary Search', 'C++']