follow the instructions
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```rust []\n\nimpl Solution {\n  pub fn last_visited_integers(nums: Vec<i32>) -> Vec<i32> {\n    let mut seen = Vec::new();\n    let mut ans = Vec::new();\n    let mut k = 0;\n\n    for num in nums {\n      if num != -1 {\n        k = 0;\n        seen.insert(0, num);\n      } else {\n        k += 1;\n        if k <= seen.len() {\n          ans.push(seen[k-1]);\n        } else {\n          ans.push(-1);\n        }\n      }\n    }\n\n    ans\n  }\n}\n```
['Rust']