Just a runnable solution
Code\n\nimpl Solution {\n    pub fn minimum_score(s: String, t: String) -> i32 {\n        let (s, t) = (s.as_bytes(), t.as_bytes());\n        let (ss, ts) = (s.
# Code\n```\nimpl Solution {\n    pub fn minimum_score(s: String, t: String) -> i32 {\n        let (s, t) = (s.as_bytes(), t.as_bytes());\n        let (ss, ts) = (s.len(), t.len());\n        let (mut k, mut j) = (ts as i32 - 1, ts as i32 - 1);\n        let mut dp = vec![-1; ts];\n\n        let mut i = ss as i32 - 1;\n        while i >= 0 {\n            if j >= 0 && t[j as usize] == s[i as usize] {\n                dp[k as usize] = i;\n                j -= 1;\n                k -= 1;\n            }\n            i -= 1;\n        }\n\n        let mut ans = k + 1;\n        if ans == 0 {\n            return 0;\n        }\n\n        j = 0;\n        for (i, &item) in s.iter().enumerate().take(ss) {\n            if j < ts as i32 && t[j as usize] == item {\n                while k < ts as i32 && dp[k as usize] <= i as i32 {\n                    k += 1;\n                }\n                ans = ans.min(k - j - 1);\n                j += 1;\n            }\n        }\n        ans as _\n    }\n}\n```
['Rust']