Go/Python O(n) time | O(n) space
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```golang []\nfunc minimumScore(s string, t string) int {\n    suffix :=make([]int,len(s))\n    j := len(t)-1\n    for i:=len(s)-1;i>=0;i--{\n        if 0 <= j && s[i] == t[j]{\n            j--\n        }\n        suffix[i] = j \n    }\n    answer := j + 1\n    j = 0\n    for i,_ := range(s){\n        answer = min(answer, max(0, suffix[i] - j + 1))\n        if j < len(t) && s[i] == t[j]{\n            j++\n        }\n    }\n    return min(answer, len(t)-j)\n}\n\nfunc min(a,b int) int{\n    if a<b{\n        return a\n    }\n    return b\n}\n\nfunc max(a,b int) int{\n    if a>b{\n        return a\n    }\n    return b\n}\n```\n```python []\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        suffix = [0 for i in range(len(s))]\n        j = len(t)-1\n        for i in range(len(s)-1,-1,-1): \n            if 0 <= j and s[i] == t[j]:\n                j -= 1\n            suffix[i] = j \n        answer = j + 1\n        j = 0 \n        for i,_ in enumerate(s): \n            answer = min(answer, max(0, suffix[i] - j + 1))\n            if j < len(t) and s[i] == t[j]:\n                j += 1\n        return min(answer, len(t)-j)\n```
['Suffix Array', 'Prefix Sum', 'Go', 'Python3']