Straight forward O(n) using basic syntax
Code
# Code
```rust []
impl Solution {
    pub fn last_visited_integers(nums: Vec<i32>) -> Vec<i32> {
        let mut seen: Vec<i32> = Vec::new();
        let mut ans: Vec<i32> = Vec::new();
        let mut neg_count: usize = 0;

        for num in nums {
            if num == -1 {
                neg_count += 1;
                if seen.len() >= neg_count {
                    ans.push(seen[seen.len() - neg_count]);
                }
                else {
                    ans.push(-1);
                }
            }
            else {
                neg_count = 0;
                seen.push(num);
            }
        }

        ans
    }
}
```
['Rust']