ANTARNAB || 100% FASTER || EASY
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```\nclass Solution {\npublic:\n    int minimumScore(string s, string t) {\n        //int minimumScore(string s, string t) {\n    int ss = s.size(), st = t.size(), k = st - 1;\n    vector<int> dp(st, -1);\n    for (int i = ss - 1; i >= 0 && k >= 0; --i)\n        if (s[i] == t[k])\n            dp[k--] = i;\n    int res = k + 1;\n    for (int i = 0, j = 0; i < ss && j < st && res > 0; ++i)\n        if (s[i] == t[j]) {\n            for (; k < t.size() && dp[k] <= i; ++k);\n            res = min(res, k - (++j));\n        }\n    return res;\n        \n    }\n};\n```
['C++']