Python Hard
```python3 []
class Solution:
    def minimumScore(self, s: str, t: str) -> int:
        '''
        we remove letters from t

        then, score = right - left + 1

        left := min index removed
        max := max index removed

        want to min score

        n^2 dp is easy

        thinking rabin karp, z function

        given we remove an index1 and index2 from t
        we may as well remove all other indices from index1 + 1....index2 - 1

        becuase score stays the same


        for each index in t, 
        maybe sliding window?

        remove a minimum of one index

        with prefix suffix arrays

        bs on prefix and suffix 

        we remove a segment in the middle

        leaving a prefix and a suffix

        we need to know if the prefix is a subseq of s and the suffix is a subseq of s and they done overlap


        The score of the string is 0 if no characters are removed from the string t

        '''
        M, N = len(s), len(t)

        pref = [M] * N
        suff = [-1] * N


        def calc(i, j):
            if i == M or j == N:
                return 

            if s[i] == t[j]:
                pref[j] = i
                calc(i + 1, j + 1)
            else:
                calc(i + 1, j)

        calc(0, 0)

        if pref[-1] != M:
            return 0

        def calc2(i, j):
            if i < 0 or j < 0:
                return 

            if s[i] == t[j]:
                suff[j] = i
                calc2(i - 1, j - 1)
            else:
                calc2(i - 1, j)

        calc2(M-1, N-1)

        


        best = 10 ** 10

   

        def good(l, r):
            p = -1
            if l > 0:
                p = pref[l-1]
            s = M
            if r < N - 1:
                s = suff[r + 1]

            return p < s


            


        l = 0


         
        for r in range(N):

            while good(l, r):
             
                best = min(best, r-l+1)
                if best == 1:
                    return best
                l += 1

            
        
        return best






        
```
['Python3']