c# easy and clean 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    List<int> seen = new List<int>();\n    List<int> ans= new List<int>();\n    int countMinusOne= 0;\n    for(int i = 0; i<nums.Length; i++)\n    {\n        if (nums[i]>0) { seen.Insert(0,nums[i]);countMinusOne=0; }\n        else\n        {\n            countMinusOne++;\n            if (countMinusOne<=seen.Count) ans.Add(seen[countMinusOne-1]);\n            else ans.Add(-1);\n        }\n\n    }\n    return ans;\n}\n}\n```
['C#']