2 pointer LEFT - RIGHT
\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nlongest increasing prefix+suffix\n Describe your approach to solving the problem. 
\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nlongest increasing prefix+suffix\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfrom copy import deepcopy\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        left=[-1]*len(t)\n        right=[-1]*len(t)\n        ind=defaultdict(deque)\n        ind2=defaultdict(deque)\n        for i in range(len(s)):\n            ind[s[i]].append(i)\n            ind2[s[i]].append(i)\n        for i in range(len(t)):\n            if ind[t[i]]:\n                while i and  ind[t[i]] and ind[t[i]][0]<left[i-1]:\n                    ind[t[i]].popleft()\n                if ind[t[i]]:\n                    left[i]=ind[t[i]].popleft()\n        ind=ind2\n        ans=len(t)\n        cnt=0\n        for i in range(len(t)-1,-1,-1):\n            cnt+=1\n            if ind2[t[i]]:\n                while i+1<len(t) and ind[t[i]] and ind[t[i]][-1]>right[i+1]:\n                    ind[t[i]].pop()\n                if ind[t[i]]:\n                    right[i]=ind[t[i]].pop()\n                    ans=min(ans,len(t)-cnt)\n            if i+1<len(t) and right[i+1]<right[i]:\n                right[i]=-1\n                break\n        hi=len(left)-1\n        for i in range(len(left)):\n            if left[i]==-1:\n                break\n            l=i\n            while  right[hi]<left[l]:\n                if hi+1<len(left):\n                    hi+=1\n                else:\n                    break\n            while hi>l and right[hi]!=-1 and right[hi]>left[l]:\n                th=hi-1\n                hi=th\n            ans=min(ans,hi-l)\n                \n        return max(ans,0)\n```
['Python3']