💥💥 Beats 100% on runtime and memory [EXPLAINED]
IntuitionThe goal is to find the minimum score after removing characters from t so that it becomes a subsequence of s. The score is determined by the leftmost a
# Intuition
The goal is to find the minimum score after removing characters from t so that it becomes a subsequence of s. The score is determined by the leftmost and rightmost indices of removed characters, so we aim to remove as few characters as possible, minimizing the range of indices involved.

# Approach
First, check if t is already a subsequence of s. Then, create an array to track the index of the first character in t that can be removed at each position in s. Next, iterate backward over s to check possible removals and calculate the smallest score by considering both valid and invalid removal scenarios. The result is the minimum score after these adjustments.

# Complexity
- Time complexity:
O(n + m), where n is the length of s and m is the length of t. This is because we make a few linear passes through both strings.

- Space complexity:
O(n), as we store the first removed indices for each position in s (in the first_removed_from_left array).

# Code
```rust []
impl Solution {
    pub fn minimum_score(s: String, t: String) -> i32 {
        let s = s.as_bytes();
        let t = t.as_bytes();
        let n = s.len();
        let m = t.len();
        
        // Check if `t` is already a subsequence of `s`
        let mut j = 0;
        for &ch in s {
            if j < m && ch == t[j] {
                j += 1;
            }
            if j == m {
                return 0;
            }
        }
        
        // Calculate the firstRemovedIndexFromLeft array
        let mut first_removed_from_left = vec![0; n];
        let mut left = 0;
        for i in 0..n {
            if left < m && s[i] == t[left] {
                left += 1;
            }
            first_removed_from_left[i] = left;
        }
        
        // Initialize the result with the worst case (remove the entire `t`)
        let mut res = m as i32;

        // Calculate the result by iterating backward over `s`
        let mut right = m as i32 - 1;
        for i in (0..n).rev() {
            if right >= first_removed_from_left[i] as i32 {
                res = res.min(right - first_removed_from_left[i] as i32 + 1);
            }
            if right >= 0 && s[i] == t[right as usize] {
                right -= 1;
            }
            res = res.min(right + 1);
        }
        
        res
    }
}

```
['Array', 'Two Pointers', 'String', 'Binary Search', 'Suffix Array', 'Binary Tree', 'Rust']