Greedy + Binary Search
\n\n# Code\npython3 []\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        \n        m = len(s)\n        n = len(t)\n        leftmost 
\n\n# Code\n```python3 []\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        \n        m = len(s)\n        n = len(t)\n        leftmost = [-1]*n\n        j = 0\n        res = n\n        for i in range(n):\n            while j<m and s[j]!=t[i]:\n                j += 1\n            leftmost[i] = j\n            if j!=m:res = min(res,n-i-1)\n            j = min(j+1,m)\n        rightmost = [-1]*n\n        j = m-1\n        for i in range(n-1,-1,-1):\n            while j>=0 and s[j]!=t[i]:\n                j -= 1\n            rightmost[i] = j\n            if j!=-1:res = min(res,i)\n            j = max(j-1,-1)\n\n        \n        for i,l in enumerate(leftmost):\n            if l == m:continue\n            j = bisect.bisect_left(rightmost,l)\n            r = -1\n            if j < n:r = rightmost[j]\n            if j < n and rightmost[j]>l:\n                res = min(res,j-i-1)\n        return max(res,0)\n        \n```
['Binary Search', 'Greedy', 'Python3']