simple binary search using prefix and suffix arrays O(nlogn) Python 3
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfrom collections import defaultdict\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        s = \'0\'+s+\'0\'\n        t = \'0\'+s+\'0\'\n        prefix_arr = [-1 for _ in range(len(t))]\n        suffix_arr = [-1 for _ in range(len(t))]\n        \n        cur_ind = 0\n        for i in range(len(s)):\n            if cur_ind >= len(t):\n                break\n            if s[i]==t[cur_ind]:\n                prefix_arr[cur_ind] = i\n                cur_ind += 1\n\n        cur_ind = len(suffix_arr)-1\n        for i in reversed(range(len(s))):\n            if cur_ind < 0:\n                break\n            if s[i] == t[cur_ind]:\n                suffix_arr[cur_ind] = i\n                cur_ind -= 1\n        min_score = len(t)\n        for i in range(len(prefix_arr)):\n            if prefix_arr[i] == -1:\n                break\n            low = i+1\n            high = len(suffix_arr)\n            while low < high:\n                mid = int((low+high)/2)\n                if suffix_arr[mid] == -1 or suffix_arr[mid]<=prefix_arr[i]:\n                    low = mid+1\n                else:\n                    min_score = min(min_score, mid-i-1)\n                    high = mid  \n        return min_score\n```
['Python3']