[Python3] forward & backward
\n\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        suffix = [-1]*len(s)\n        j = len(t)-1\n        for i in reversed(range(len
\n```\nclass Solution:\n    def minimumScore(self, s: str, t: str) -> int:\n        suffix = [-1]*len(s)\n        j = len(t)-1\n        for i in reversed(range(len(s))): \n            if 0 <= j and s[i] == t[j]: j -= 1\n            suffix[i] = j \n        ans = j + 1\n        j = 0 \n        for i, ch in enumerate(s): \n            ans = min(ans, max(0, suffix[i] - j + 1))\n            if j < len(t) and s[i] == t[j]: j += 1\n        return min(ans, len(t)-j)\n```
['Python3']