Simple Solution
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```\npublic class Solution {\n    public IList<int> LastVisitedIntegers(int[] nums) {\n        int k = 0;\n        List<int> seen = new List<int>();\n        List<int> ans = new List<int>();\n\n        for(int i = 0; i < nums.Length;i++){\n            if(nums[i] >= 0){\n                k = 0;\n                seen.Insert(0,nums[i]);\n            }\n            else{\n                k++;\n                if(k <= seen.Count){\n                    ans.Add(seen[k-1]);\n                }\n                if(k > seen.Count){\n                    ans.Add(-1);\n                }\n            }\n        }\n        return ans.ToArray();\n    }\n}\n```
['C#']